O'Reilly logo

Korn Shell: Unix and Linux Programming Manual, Third Edition, The by Anatole Olczak

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

Redirecting Input/Output

The Korn shell provides a number of operators that can be used to manipulate command input/output, files, and co-processes.

I/O Redirection Operators

<file redirect standard input from file
>file redirect standard output to file. Create file if non-existent, else overwrite.
>>file append standard output to file. Create file if non-existent.
>|file redirect standard output to file. Create file if non-existent, else overwrite even if noclobber is set.
<>file open file for reading & writing as standard input
<& close standard input
>& close standard output
<&n redirect standard input from file descriptor n
>&n redirect standard output to file descriptor n
n<file redirect file descriptor n from file
n>file redirect file ...

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