shell脚本命令
1.创建文件$HOME/test/test.log
ROOTDIR=$HOME/test
testfile=$ROOTDIR/test.log
touch $testfile
2.如果文件存在则删除文件
?
if [ -f $testfile ];then
rm -rf $testfile
fi
3.如果文件不存在则创建文件
?
if [ ! -e $testfile ]; then
touch $testfile
fi
ps:

?
4.清空文件内容
?
发布时间: 2012-11-17 11:14:15 作者: rapoo
shell脚本命令
1.创建文件$HOME/test/test.log
ROOTDIR=$HOME/test
testfile=$ROOTDIR/test.log
touch $testfile
2.如果文件存在则删除文件
?
if [ -f $testfile ];then
rm -rf $testfile
fi
3.如果文件不存在则创建文件
?
if [ ! -e $testfile ]; then
touch $testfile
fi
ps:

?
4.清空文件内容
?