O'Reilly logo

Solaris™ 8 Advanced System Administrator's Guide, Third Edition by Janice Winsor

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

Input and Output

When you write shell scripts, you want to be able to obtain input from sources outside your scripts; for example, from another file or from keyboard input. You also want to be able to generate output both for use within the script and for display on-screen.

The following sections describe how to control input and output of a shell script, using standard input, output, error, and redirection; how to accept user input (input from the keyboard) to a script; how to create “here” documents; and how to generate output to the screen.

Standard In, Standard Out, and Standard Error

When writing shell scripts, you can control input/output redirection. Input redirection forces a command to read any necessary input from a file instead of ...

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