Redirecting InputOutput

   

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

Table of Contents
Appendix G.  Pdksh Quick Reference


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

<&?/span>

close standard input

>&?/span>

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 descriptor n to file

n>>file

redirect file descriptor n to file. Create file if non-existent, else overwrite.

n>|file

redirect file descriptor n to file. Create file if non-existent, else overwrite even if noclobber is set.

n<&m

redirect file descriptor n from file descriptor m

n>&m

redirect file descriptor n to file descriptor m

n<>file

open file for reading & writing as file descriptor n

n<<word

redirect to file descriptor n until word is read

n<<?/span>word

redirect to file descriptor n until word is read; ignore leading tabs

n<&?/span>

close file descriptor n for standard input

n>&?/span>

close file descriptor n for standard output

n<&p

redirect input from co-process to file descriptor n. If n is not specified, use standard input.

n>&p

redirect output of co-process to file descriptor n. If n is not specified, use standard output.


       
    Top
     



    Korn Shell. Unix and Linux Programming Manual, Third Edition
    Korn Shell. Unix and Linux Programming Manual, Third Edition
    ISBN: N/A
    EAN: N/A
    Year: 2000
    Pages: 177

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net