[semi-OT] Pretty vs. Useful output
Michael ODonnell
michael.odonnell at comcast.net
Tue Oct 6 13:50:18 EDT 2009
>> No need to stick it in /proc, but parsing the output of utilities with
>> scripts is subject to all kinds of potential errors and inefficiencies.
>
> If that's your concern, the utility should have an output mode
>that's more friendly to machine interpretation. :)
<rant>
Grrrrr!! A long-standing source of frustration for me is that people who
definitely should know better insist on writing code that utters only
"pretty" outputs instead of useful, parseable info. Yes, it's darling
and precious that the authors of (say) mdadm, dumpe2fs or /proc/cpuinfo
spent so much time arranging for their output to be so neatly lined up,
but it's a fscking PITA for scripts to pluck useful info from within
that sort of dreck.
If I were king I'd decree that all software be capable of uttering its
output in a manner that can easily be scanned for items of interest,
using a format like (say) key=value pairs or maybe (the disappointingly
oversold) XML. You can always prettify info delivered in a regular
format but going the other way is, as already mentioned, error-prone
and inefficient.
</rant>
More information about the gnhlug-discuss
mailing list