[筆記] 將日期變數 date variable 加入 bashrc
vim /etc/bashrc ( or /HOME_DIR/.bashrc)
export datecode=date +"%Y%m%d"
以後就可以直接使用 $datecode 來產生今天的日期給備份的命令用
[root@w ~]# touch test_$datecode [root@w ~]# ls anaconda-ks.cfg ** test_20151222 ** yum.txt [root@w ~]#
vim /etc/bashrc ( or /HOME_DIR/.bashrc)
export datecode=date +"%Y%m%d"
以後就可以直接使用 $datecode 來產生今天的日期給備份的命令用
[root@w ~]# touch test_$datecode [root@w ~]# ls anaconda-ks.cfg ** test_20151222 ** yum.txt [root@w ~]#