“ – ”是bash中stdout的快捷方式吗?如果不是什么意思?例如,
wget -q -O - $line
stdin怎么样?
感谢致敬!
据我所知,bash没有涉及破折号的使用.它只是许多UNIX命令行实用程序的约定 – 在命令行上代替输入或输出文件名时,作为stdin或stdout的占位符.
编辑:找到它,此行为在The Open Group Base Specifications的POSIX Utility Syntax Guidelines,§12.2.13中指定:
For utilities that use operands to represent files to be opened for either reading or writing,the ‘-‘ operand should be used only to mean standard input (or standard output when it is clear from context that an output file is being specified).