3.1. Text-Based Pipelines

The pattern of chaining commands has been in practice for quite some time, and it has been implemented in most shells like so: each command reads text as its input and, in turn, generates text as its output. This is very easy to implement and provides a basic way to pass data around. Unfortunately, using text as the data transport has several drawbacks. The most important one is that there is no standard data format. Each command is free to generate whatever text it wishes, and that makes consuming data hard, as we have to parse the input and make something meaningful out of it. It is considered good form among command developers to generate output that is easy to parse, as that makes a tool more usable. Of course, ...

Get Pro Windows PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.