mardi 3 mars 2015

Calculate date difference between Last modified date of a file and NOW using shell script


I am trying to calculate the time elapse since the log file was last updated.


I guess following commands will be used


lastUpdate=$(date -r myLogFile.log)

now=$(date)


how can i subtract them and get result for number of seconds elapsed?



Aucun commentaire:

Enregistrer un commentaire