美文网首页Shell
linux shell编写以日期时间为文件名的脚本

linux shell编写以日期时间为文件名的脚本

作者: 剑御 | 来源:发表于2016-05-04 17:02 被阅读512次
#!/bin/sh
#log
MYDATE=`date %d%m%y`
#append MYDATE to the variable LOGFILE that holds the actual filename of the log
LOGFILE=/root/test_log.$MYDATE
#create the file
>$LOGFILE
MYTIME=`date %d%R`
LOGFILE2=/root/test_logtime.$MYTIME
#create the file
>$LOGFILE2

相关文章

网友评论

    本文标题:linux shell编写以日期时间为文件名的脚本

    本文链接:https://www.haomeiwen.com/subject/rbnrrttx.html