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

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

问题描述

我是 shell 脚本的新手,对 &- 的用法有疑问

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

我有一个只有一行的 shell 脚本:echo Hello.shell 脚本名为 demo.sh

I have a shell script with a single line: echo Hello. The shell script is named demo.sh

执行时做了什么:

./demo.sh 0>&-

谢谢.

推荐答案

它关闭文件描述符 - 在本例中为标准输入 (0).

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

另见:

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

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