#!/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
红色的这段是什么意思,哪位帮忙解释下!!!
bibay 于 2009-08-13 20:53:17发表:
书上是说为了避免用户随意按Enter,使用变量功能分析是否设置了文件名
huangfu 于 2006-12-11 13:53:25发表:
没人帮忙嘛 斑竹出来帮帮忙吧!!!!!