| cmd stderr destination |
|||||
| console |
file1 (Note: /dev/null for any file makes that data disappear.) |
file2 != file1 |
stdin of next cmd in pipeline (Note: Using ' tee file' forcmd2 makes its stdin go to console and file simultaneously). |
||
| cmd stdout destination |
console |
cmd |
bash: cmd 2>file1tcsh: (cmd > /dev/tty) >& file1 |
N/A: See left |
bash: cmd 2>&1
1>/dev/tty | cmd2bash: (cmd > /dev/tty) 2>&1 | cmd2tcsh: (cmd > /dev/tty) |& cmd2 |
| file1 |
cmd > file1 |
cmd >& file1 |
bash: cmd 1>file1
2>file2bash: (cmd > file1) >& file2tcsh: (cmd > file1) >& file2 |
bash: cmd 2>&1
1>file1
| cmd2bash: (cmd > file1) 2>&1 | cmd2tcsh: (cmd > file1) |& cmd2 |
|
| stdin of next cmd in pipeline |
cmd | cmd2 |
bash: cmd 2>file1 |
cmd2tcsh: ??? |
N/A: See left |
bash: cmd 2>&1 |
cmd2tcsh: cmd |& cmd2 |
|
| stderr (useful to make echo in a shell script print to stderr instead of stdout) |
bash: cmd 1>&2tcsh: ??? |
||||
andy_fingerhut <a with a circle around it> alum [period]
wustl
[period] edu