Windows 和 Linux 下生成以当前时间命名的文件
在 Windows、Linux 操作系统,分别利用BAT批处理文件和Shell脚本,生成类似“20110228_082905.txt”以“年月日_时分秒”命名的文件。 Windows BAT批处理文件:@echo offset 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%_%...