In a bash script, if I have a number that represents a time, in the form hhmmss (or hmmss), what is the best way of subtracting 10 minutes?
ie, 90000 -> 85000
why not just use epoch time and then take 600 off of it?
$ echo "`date +%s` - 600"| bc; date 1284050588 Thu Sep 9 11:53:08 CDT 2010 $ date -d '1970-01-01 UTC 1284050588 seconds' +"%Y-%m-%d %T %z" 2010-09-09 11:43:08 -0500