echo "Please input the file name: "
read fileuser
#Avoid the User type the 'Enter' directly
filename=${fileuser:-"filename"}
#Capture the date for three days
Yesterday=`TZ=GMT+16 date +%Y%m%d`
Today=`date +%Y%m%d`
Tomorrow=`TZ=GMT-32 date +%Y%m%d`
YesterdayFile=${filename}${Yesterday}
TodayFile=${filename}${Today}
TomorrowFile=${filename}${Tomorrow}
#Create the file in the current folder
touch "$YesterdayFile"
touch "$TodayFile"
touch "$TomorrowFile"
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/522544/viewspace-700915/ ,如需转载,请注明出处,否则将追究法律责任。