bash比较文件时间和当前时间ft=`date +%Y%m%d%H%M%S -Iseconds -r filea`
bash比较文件时间和当前时间ct
=`date +%Y%m%d%H%M%S -Iseconds`
bash比较文件时间和当前时间
if [ "$ct" -gt "$ft" ]
bash比较文件时间和当前时间then
bash比较文件时间和当前时间  echo 
"Current Time Large than file time"
bash比较文件时间和当前时间  echo 
"$ct - $ft = "
bash比较文件时间和当前时间  echo $[
$ct-$ft]
bash比较文件时间和当前时间fi 

上面的秒数计算是不对的。

echo $[`date +%H` * 3600 + `date +%M` * 60 + `date +%S`]
这样算出来的就是准确的秒啦.

相关文章: