ssdr / blog

:diamonds: 岁月如歌,记录点滴。
0 stars 1 forks source link

20190418 Process Substitution #3

Open ssdr opened 5 years ago

ssdr commented 5 years ago

来自Wikipedia:

In computing, process substitution is a form of inter-process communication that allows the input or output of a command to appear as a file. The command is substituted in-line, where a file name would normally occur, by the command shell. This allows programs that normally only accept files to directly read from or write to another program.

语法格式:

<(<some command> <args>)

举例:

diff <(sort list-1.txt) <(sort list-2.txt)
ssdr commented 3 years ago

另一个例子: oss hash --type=md5 <(echo 'hello world')