You can think of this like a really simple stopwatch. I'm trying to hack together a bash script that displays the elapsed time since a specified date and updates the output every second.
First, Inside the script you'd specify a UNIX date: Fri Apr 14 14:00:00 EDT 2011
. This would be when the stopwatch starts.
Now, when you run the script, you'd see...
06d:10h:37m:01s
and a few seconds later you'd see...
06d:10h:37m:05s
I'm not trying to have a new line printed for every second that elapses. The script should only have 1 line of output, and update it every second. Obviously you could quit the script and start it up again at any time, and it would still be right on since the starting time is hard coded.
Any ideas?