更新时间:2023-11-06 11:40:40
使用cat < file
,cat
会从其标准输入中读取内容; Shell将打开文件,并将文件句柄连接到cat
.使用cat file
,cat
本身无需任何外壳程序即可打开文件.两者的最终结果确实是相同的:cat
读取file
的内容并将其输出到标准输出.
With cat < file
, cat
reads from its standard input; the shell opens the file and connects the file handle to cat
. With cat file
, cat
itself opens the file without any shell involvement. The end result is indeed the same for both: cat
reads the contents of file
and outputs them to standard output.