我知道我可以在Linux系統中使用date +%s
和stat
。如何創建比較文件的shell腳本文件修改時間和Solaris上的當前時間
但是,由於Solaris不支持那些格式或命令的紀元, 如何創建一個shell腳本來比較文件修改時間和當前時間?
與當前時間相比,修改文件時間應該在10分鐘之內。
[ShellScript]
Current_Time=
Modification_Time=
Compare = Current_Time - Modification_time
if ["$Compare" -gt 600]; then
Echo "there is no find found within 10 min"
else
Echo "Found the file"
if
了'date' cmd在'/ usr/xpg4/bin'具有額外的功能,可以讓你的任務變得更容易,但是我6年來沒有訪問過Solaris,所以我可能會誤會。祝你好運。 – shellter