Programming and posix - February 2001
February 10, 2001
Solution Symposium
Page 77
hp e3000
programming
and posix
posix shell i/o redirection
• <file - read stdin from file
• >file - write stdout to file
• >>file - append stdout to file
• 2>file - write stderr (2) to file
• 2>&1 - write stderr (2) to the same place as stdout (1)
• <<name - read stdin from the following lines of shell input
until a line consisting of name is found
/bin/cat <<ALLDONE >file
here is some data
to be copied to a file
ALLDONE