问题
I am new to shell scripting and having a doubt regarding the usage of &-
I have a shell script with a single line: echo Hello
.
The shell script is named demo.sh
What does it do when it is executed as:
./demo.sh 0>&-
Thanks.
回答1:
It closes the file descriptor - standard input (0) in this case.
See also:
- http://www.tldp.org/LDP/abs/html/io-redirection.html
来源:https://stackoverflow.com/questions/38782395/redirecting-the-output-of-shell-command-to-what-does-it-mean