Reputation: 77
I have basic knowledge of linux bash shell scripting, right now I am facing a problem that is like following:
So, can anyone help me.
Also, some proof of concept :
while true;
do
func1();
func2();
check file is updated or not
if updated ; then
break;
else
continue;
Upvotes: 3
Views: 741
Reputation: 2466
You probably want the stat
command. Do man stat
to see how yours works. You want to look for "modtime" or "time of last data modification" option. For mine that would be stat -c%Y file
. Something like basemodtime=$(stat -c%Y file)
before the loop, modtime=$(stat -c%Y file)
after func2()
, and then if [ $modtime != $basemodtime ]; then
to detect "updated".
Upvotes: 2