FILETIME1=$(stat $LOG -c %Y) ;
TIMEDIFF1=$(expr $CURTIME - $FILETIME1)
I have a script to check log updates and do ( If else ) depending on the output of TIMEDIFF1.
I created this script in Ubuntu and it works fine there but on SunOS, (Generic_150400-64 sun4v sparc sun4v), it is not working; I figured nawk might work, but I'm not sure.
How to assign the value of LOG to FILETIME1 in seconds format? How to subtract the value of CURTIME from FILETIME1? Can someone please help me, by providing the exact commands to do this?