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

#!/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
    原文作者:剑御
    原文地址: https://www.jianshu.com/p/f5e9f60d08f6
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞