更新时间:2022-06-15 03:59:30
文件描述符2
表示标准错误. (其他特殊文件描述符包括用于标准输入的0
和用于标准输出的1
).
File descriptor 2
represents standard error. (other special file descriptors include 0
for standard input and 1
for standard output).
2> /dev/null
表示将标准错误重定向到/dev/null
. /dev/null
是一种特殊的设备,它将丢弃所有写入其中的内容.
2> /dev/null
means to redirect standard error to /dev/null
. /dev/null
is a special device that discards everything that is written to it.
将这些代码放在一起,将命令ls $directory_/fallback_* 2> /dev/null
的标准输出存储到变量scriptlist
中,并丢弃标准错误.
Putting all together, this line of code stores the standard output of command ls $directory_/fallback_* 2> /dev/null
into the variable scriptlist
, and the standard error is discarded.