|
#!/bin/bash
#program:
# user can keyin filename to touch 3 ne files.
#history:
#2006/12/04 huangfu first release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
echo -e "i will use 'touch' command to create 3 files ."
read -p " please input the filename what you want : " fileuser
filename=${fileuser:-"filename"} #这一行啥意思啊 迷茫啊 哪位高人解释一下。
date1=`date -d "-2 day " +%Y%m%d`
date2=`date -d "-1 day " +%Y%m%d`
date3=`date +%Y%m%d`
file1="$filename""_""$date1"
file2="$filename""_""$date2"
file3="$filename""_""$date3"
touch $file1
touch $file2
touch $file3 |
|