3 ms·
Two comments: 1) Really? This is on the front page of HN? 2) why aren't you printing to stderr?
by niggler 14y ago
Two comments:
1) Really? This is on the front page of HN?
2) why aren't you printing to stderr?
- octo_t 14y agoIts Sunday, frontpage tends to be quite dead. (No idea why not stderr however)
- latitude 14y ago1) Slow news day ... and this being an example of read's -t option put to a good use. 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.
- nitrogen 14y agoOne argument against using stderr: IIRC stdout defaults to line buffering (or more if piped), while stderr is flushed immediately, so using stderr vs. stdout can yield different results.