4 ms·
Very good article. Another point that I think is valuable is: "Output one line per record data" This is useful if your CLI that has to output data to the user
by fredrb 10y ago
Very good article.
Another point that I think is valuable is: "Output one line per record data"
This is useful if your CLI that has to output data to the user. Makes it easier to interface with programs like `grep`
- gizmo686 10y agoI'd add to that an option to deliminate records with NUL instead of new line and treat all other characters as literals.
- shabble 10y agoSuppressing the header line and any fancy formatting jazz is a nice idea as well, since otherwise there's invariably some buggery needed to strip it like: ps | tail -n +2 | cmd_with_just_records or, if you're doing column extraction as well, I like: ps | perl -lanE'say $F[0] if 2..eof' [ps used here as a stand-in for some other command that has a fixed header. I'm aware that you can omit it via hte somewhat long-winded `ps -o "pid= command= [...]"' there, but afaik there's no simple switch for 'do what you were going to, just without a header line at the top']