Re:The Rule of Silence (2006)
by bandrami on Tuesday December 13, 2016 @09:46AM
(#13167099)
Can you name me a single UNIX configuration file whose format is not "structured"?
[ Parent
| on HN ]
Config files are less of a problem. The issue is with programs, which you want to use with pipes. Each has its own undocumented, arbitrary pseudo-structure with often inconsistent semantics, optimized for viewing by user.
What programs are you thinking of? Maybe this is my sysadmin bias but about 90% of my UNIX tools usage is on config files...
Let me suggest an incendiary example: systemd
systemctl status wibble.service : Displays human-readable information, with colours, line drawings, and variable-length free-form text; that is exceedingly hard for a program to parse reliably.
Contrast with
systemctl show wibble.service : Outputs machine-readable information, in systemd's favourite form of a Windows INI file.
Yikes. Makes me glad I run Slackware. Though I seem to recall from The Init Wars that it was precisely this quality of SystemD that made people lob the charge that it violated the "Unix philosophy"
ls, ps, du, df, ... pretty much all CLI tools. The kind you use in scripts.
All four of which users are enjoined, over and over again, not to try to parse the output of (particularly ls). That is, those are the tools specifically not meant to be connected by pipelines, but merely used for operator convenience.
Re:The Rule of Silence (2006)
by qwertyuiop924 on Tuesday December 13, 2016 @05:17PM
(#13171666)
...But how do you extract that data otherwise?
Instead of ls, find. Instead of ps, you parse the nodes in the /proc filesystem that ps itself parses. Ditto the /sys filesystem and du/df.
Re:The Rule of Silence (2006)
by qwertyuiop924 on Wednesday December 14, 2016 @01:30PM
(#13178365)
When those tools were written, /sys and /proc didn't exist.