Show HN: now.sh
11–20 of 45 posts
Re: Show HN: now.sh
#12I'm not sure I really see a point in this. How are you going to forget the server's time zone when it's listed in the timestamps? It doesn't really make sense.
Re: Show HN: now.sh
#13 [start time] $ ./run_long_script
[ end time ] $
My actual prompt looks like: [09:36] bmd-mba|bmd ~
$ whoami
bmd
[09:36] bmd-mba|bmd ~
$
Details in https://github.com/coderholic/config/blob/master/.bash_profi...Re: Show HN: now.sh
#14I'm not sure I really see a point in this. How are you going to forget the server's time zone when it's listed in the timestamps? It doesn't really make sense.
It's for the cases when you are in a different timezone than the server. When the log says "03/Mar/2013 09:24:13 -0800" and it's 13:50 where I am, it takes me a while to understand how old that line is.
Re: Show HN: now.sh
#15I have the current time printed in my prompt, which means I can easily see how long commands took to run, eg: [start time] $ ./run_long_script [ end time ] $ My actual prompt looks like: [09:36] bmd-mba|bmd ~ $ whoami bmd [09:36] bmd-mba|bmd ~ $ Details in https://github.com/coderholic/config/blob/master/.bash_profi...
Re: Show HN: now.sh
#16I have the current time printed in my prompt, which means I can easily see how long commands took to run, eg: [start time] $ ./run_long_script [ end time ] $ My actual prompt looks like: [09:36] bmd-mba|bmd ~ $ whoami bmd [09:36] bmd-mba|bmd ~ $ Details in https://github.com/coderholic/config/blob/master/.bash_profi...
Re: Show HN: now.sh
#17I have the current time printed in my prompt, which means I can easily see how long commands took to run, eg: [start time] $ ./run_long_script [ end time ] $ My actual prompt looks like: [09:36] bmd-mba|bmd ~ $ whoami bmd [09:36] bmd-mba|bmd ~ $ Details in https://github.com/coderholic/config/blob/master/.bash_profi...
Is there a way to do this so the timestamp includes seconds? Thanks.
Re: Show HN: now.sh
#18e.g. echo "03/Mar/2013 01:16:52 +0000" | mytz => 02/Mar/2013 17:16:52 -0800
Re: Show HN: now.sh
#19Earlier quoted context omitted.
It's for the cases when you are in a different timezone than the server. When the log says "03/Mar/2013 09:24:13 -0800" and it's 13:50 where I am, it takes me a while to understand how old that line is.
Right, the server says its timezone is -0800. You don't know what timezone you are currently in?
Re: Show HN: now.sh
#20Another alternative is 'ts' which is part of joey hess's awesome collection of unix tools, moreutils.[1] I did not find out about ts until too late so I am still in the habit of using tai64n from djb's daemontools, which adds a tai64 timestamp to every file[2] and then tai64nlocal[3] in order to convert the timestamps to something useful to humans. If you don't know about moreutils check out the collection. I don't k…
If I read ts source right, it merely prepends the current time to every line it echoes from stdin to stdout. now is different. It re-prints current time once a second while waiting for the input. You basically get the running clock at the last line of output.