2014-01-10 50 views

回答

1

感謝究竟你「上次執行時間」是什麼意思?我的回答工作與上次修改時間:

在外殼,可以使用-nt-ot測試:

if [ "$file1" -nt "$file2" ] ; then 
    echo "$file1 is newer than $file2." 
fi 

在Perl,使用-M文件測試:

if (-M $file1 < -M $file2) { 
    print "$file1 is newer than $file2.\n"; 
}