【转】How to append current date and timestamp to filename in shell script

$ date +"FORMAT"

now=$(date +"%Y-%m-%d-%S")
filename="my_program.$now.log"
# example filename: my_program.2012-01-23-47.log
now=$(date +"%Y.%m.%d.%S.%N")
filename="my_program.$now.log"
# example filename: my_program.2013.01.23.44.364617000.log
now=$(date +"%s")
filename="my_program.$now.log"
# example filename: my_program.1358995092.log
上一篇:【转】Windows下selenium+python自动化测试环境搭建


下一篇:day60 pymysql