将shell命令的输出重定向到&-是什么意思 [英] redirecting the output of shell command to &- what does it mean

查看:120
本文介绍了将shell命令的输出重定向到&-是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是shell脚本的新手,对&-

I am new to shell scripting and having a doubt regarding the usage of &-

我有一个shell脚本,其中只有一行:echo Hello. 外壳程序脚本名为demo.sh

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>&-

谢谢.

推荐答案

它关闭文件描述符-在这种情况下为标准输入(0).

It closes the file descriptor - standard input (0) in this case.

另请参阅:

这篇关于将shell命令的输出重定向到&-是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆