četrtek, 21. maj 2009

When I came to work

If I want to know when I came to work in the morning I use this piece of code:
LANG=en_us date "+%b %d" | xargs -i grep -m1 -i {} /var/log/syslog.0 | awk '{ print "Today I got to work at " $3 }'

I can use this since I power up my laptop every morning.
I got this one on a blog that I cannot find now, so I hope the author will not be angry with me. I just added LANG=en_us since the date format in syslog.0 is in en_us.

Ni komentarjev: