I'm looking for an easy way to track time I work on a project using the command line. I do
echo "$(date) : Start" >>worktime.txt
When I start working and
echo "$(date) : End" >>worktime.txt
When I stop working. The result is a file of the form:
kent@rat:~/work$ cat worktime.txt
Fri Jan 2 19:17:13 CET 2009 : Start
Fri Jan 2 19:47:18 CET 2009 : End
Fri Jan 2 21:41:07 CET 2009 : Start
Fri Jan 2 22:39:24 CET 2009 : End
"Start" and "End" are meant as descriptions and could have been any other text. It is certain that every odd line contains a start date and time before : and every even line contains an end date and time.
What I would like to do is sum up my worked time by parsing the text file using bash, tr, sed, awk and the other common Unix/Linux tools. I prefer using this approach instead of using Python, Perl, Haskell, Java etc.
All ideas welcome!