The concept behind it is
that programs intended for use in command pipelines should make no assumptions about what
their input might look like or do any massaging of the output.
Consider the cut command shown in the first command pipeline. It takes arbitrarily formatted
input and allows the user to specify on what piece of data to operate (the fifth field in the example,
where fields are colon-delimited) and then just displays the requested data on standard output.
cut doesn??™t do any post-processing of the output, allowing the user to do with it as he or she
pleases, probably using another tool.
758
Programming in Linux Part VI
The fourth rule is really more a philosophical observation in that you can??™t really predict all the ways
in which your program might be put to use. Indeed, as S.C. Johnson once noted, ???A successful
[software] tool is one that was used to do something undreamed of by its author.???
The point is that the Linux toolkit, for both developers and end users, is full of small tools and
utilities that are building block programs routinely used to create larger programs and tools that,
together, perform complex tasks that no single program can do, or can do efficiently. Another
element of the building blocks approach is that it enables tasks to be performed in batch mode,
without active user intervention or participation.
Pages:
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383