Link to home
Start Free TrialLog in
Avatar of zeraxis_ee
zeraxis_ee

asked on

compare dates in shell script

I need to compare 2 dates (date now and one from a file) and if date now is 20 minutes more than the date in the file, the script needs to restart the browser.

cat lastplaylist    gives me the date in the file:Fri Feb 13 05:48:51 GMT 2009
date gives me date and time now: Fri Feb 13 08:48:51 GMT 2009

I know I can restart the browser by
killall firefox
firefox http://mywebsite.com

I just don't know how to compare the 2 dates and see the difference in minutes.

Could someone help?

Many thanks
ASKER CERTIFIED SOLUTION
Avatar of Maciej S
Maciej S
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zeraxis_ee
zeraxis_ee

ASKER

That works perfectly... thank you