-
UID:15544
-
- 注册时间2007-03-05
- 最后登录2025-06-12
- 在线时间26458小时
-
- 发帖28289
- 搜Ta的帖子
- 精华28
- 飞翔币1597
- 威望888
- 飞扬币132492
- 信誉值0
-
访问TA的空间加好友用道具
- 发帖
- 28289
- 飞翔币
- 1597
- 威望
- 888
- 飞扬币
- 132492
- 信誉值
- 0
|
在 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
|