Show HN: now.sh
github.com
Show HN: now.sh
1–10 of 45 posts
Re: Show HN: now.sh
#21) Really? This is on the front page of HN?
2) why aren't you printing to stderr?
Re: Show HN: now.sh
#3Two comments: 1) Really? This is on the front page of HN? 2) why aren't you printing to stderr?
(No idea why not stderr however)
Re: Show HN: now.sh
#4Re: Show HN: now.sh
#5Re: Show HN: now.sh
#6Re: Show HN: now.sh
#7Two comments: 1) Really? This is on the front page of HN? 2) why aren't you printing to stderr?
2) Ah, pedantic nitpicking, love it. Because the script is meant for interactive use with no streams redirected off the terminal, and because it doesn't output diagnostics or errors, but rather augments the stdout.
Or put differently - show me an example where writing into stderr would make more sense.
(edit) I guess someone can tee the output afterwards. Fine, I'll make it use stderr.
Re: Show HN: now.sh
#8Re: Show HN: now.sh
#9If you don't know about moreutils check out the collection. I don't know what I'd do without vipe or vidir:
Chronic: runs a command quietly unless it fails
combine: combine the lines in two files using boolean operations
ifdata: get network interface info without parsing ifconfi
ifne: run a program if the standard input is not empty
isutf8: check if a file or standard input is utf-8
lckdo: execute a program with a lock held
mispipe: pipe two commands, returning the exit status of
parallel: run multiple jobs at once
pee: tee standard input to pipes
sponge: soak up standard input and write to a file
ts: timestamp standard input
vidir: edit a directory in your text editor
vipe: insert a text editor into a pipe
zrun: automatically uncompress arguments to command
[1] http://joeyh.name/code/moreutils/Re: Show HN: now.sh
#10Another 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…
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.