O'Reilly logo

SAMS Teach Yourself Unix in 10 Minutes by Robert Shimonski

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

STDIN

STDIN stands for standard input. The input connection for a program is called STDIN. A program can expect the incoming data stream from the user (or wherever) to appear at STDIN. User input is read from STDIN. As just mentioned, data can be redirected or piped into a program's STDIN from any source; this was shown with the examples of the cat command. The normal input for a program is generally taken from the most common of input peripherals, the keyboard. Remember our last example?

> cat  < testfile1  >  testfile2

STDIN, when used with cat as it is in this example, changes the default input channel to specify a different place to get input from, which happens to be testfile1 instead of the default, the keyboard.

When you interact with a ...

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