redirecting the output of shell command to &- what does it mean

会有一股神秘感。 提交于 2019-12-12 03:11:58

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!