Hacker News new | past | comments | ask | show | jobs | submit login

...unless you're writing to a file, in which case you'll require a couple tries and a higher quantum of shell comprehension.

This is a persistent limitation of the in-band text-only model. But I think this misuse of STDERR would be more confusing than helpful.

If `heights` was a file, you could do this:

  % head -1 heights ; sed 1,1d heights | sort -k2 -nr
If `heights` is an executable that would be expensive to call twice:

  % heights > /tmp/heights ; head -1 /tmp/heights ; sed 1,1d /tmp/heights | sort -k2 -nr
Or you could pipe to `awk`, etc.

Granted, these other options are less convenient, but they are also less surprising, and they work even if the executable creator has different ideas.

Sometimes you gotta do what you gotta do.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: