在 Windows、Linux 操作系统,分别利用BAT批处理文件和Shell脚本,生成类似“20110228_082905.txt”以“年月日_时分秒”命名的文件。

  Windows BAT批处理文件:
@echo off
set time_hh=%time:~0,2%
if /i %time_hh% LSS 10 (set time_hh=0%time:~1,1%)
set filename=%date:~,4%%date:~5,2%%date:~8,2%_%time_hh%%time:~3,2%%time:~6,2%
echo test >> %filename%.txt


  Linux Shell 脚本:
#!/bin/sh
echo test >> $(date -d "today" +"%Y%m%d_%H%M%S").txt






技术大类 » PHP/JS/Shell | 评论(311) | 引用(4) | 阅读(143193)
Mangalam Email Homepage
2022-2-2 20:21
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
Ramjan Email Homepage
2022-3-4 23:23
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
Mohan Email Homepage
2022-3-26 21:48
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
Aravindan Email Homepage
2022-5-5 23:15
I ‘d mention that most of us visitors are endowed to exist in a fabulous place with very many wonderful individuals with very helpful things.
Piryan Email Homepage
2022-5-10 23:16
Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site.
shz Email
2022-7-19 21:46
I see some amazingly important and kept up to length of your strength searching for in your on the site  Scam Risk
shzz Email
2022-7-19 21:48
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.  Scam Risk
shz Email
2022-7-19 21:49
I think it could be more general if you get a football sports activity  Scam Risk
shz Email
2022-7-19 21:52
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one.  Scam Risk
shzz Email
2022-7-19 21:52
This website and I conceive this internet site is really informative ! Keep on putting up!  Scam Risk
shz Email
2022-7-19 21:55
Your music is amazing. You have some very talented artists. I wish you the best of success.  Scam Risk
shz Email
2022-7-19 22:52
Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people..  Scam Risk
shz Email
2022-7-19 22:56
There is definately a great deal to know about this subject. I like all of the points you've made.  Scam Risk
shzz Email
2022-7-19 22:56
I think about it is most required for making more on this get engaged  Scam Risk
分页: 16/16 第一页 上页 11 12 13 14 15 16 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]