Some learnings
Saturday, December 8, 2018
Shell script for finding file modification time.
This script finds the file modified after 120 seconds.
#!/bin/sh
last_modified=`stat -c "%Y" $file`
if [ $((current-$last_modified)) -gt 120 ]; then
echo "old";
else
echo "new"
fi
***
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment