O'Reilly logo

Ruby Phrasebook by Jason Clinton

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Working with Pipes

A quick review for those who don’t swim in *nix operating systems or aren’t familiar with pipes from other programming experience:

Every program has three basic file descriptors: 0, 1, and 2. These file descriptors have been traditionally named STDIN, STDOUT, and STDERR, respectively—commonly referred to as pipes. Most programs output any kind of error message to STDERR. In addition, any sort of output that you might want to display, pipe to a file, or parse is output to STDOUT. STDIN is used for either interactive keyboard input or to receive input from another program’s STDOUT. Here is an example of such a link between programs using pipes; the link is created by the use of the pipe (|) character in the shell:

ruby ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required