It's a question about bash shell command. "sh a.sh <&0 >&0" What dose it mean? Especially, I'm not very clear about what does &0 mean?
migrated from serverfault.com Jul 27 '13 at 9:39
This question came from our site for professional system and network administrators.
& followed by a digit in that case indicates a file number. File number 0 is standard input (
So, in short, this command means to run
In this case,
One case this would be reasonable is if the parent shell's standard output file were strangely closed. This is a strange edge case.
The only difference between the two operators is when
That would be the case in cases where fd 0 points to the terminal device, because terminal emulators or
So maybe whoever wrote that wanted to redirect stdout to the terminal assuming that stdin was pointing to it.
The only place where
Redirects the standard output of
would feed first the original stdin and then