小编ste*_*veb的帖子

How to detect an error using process substitution

This question is similar to the following link, but focused on using the command line (bash shell).

Using a simple example, when doing the following command:

$ cat <(date); echo $?
Fri Jul  7 21:04:38 UTC 2017
0
Run Code Online (Sandbox Code Playgroud)

The exit value is 0 as expected.

In the following command there is an error introduced on purpose, but the return value is still 0:

$ cat <(datE); echo $?
bash: datE: command not found...
Similar command is: 'date'
0
Run Code Online (Sandbox Code Playgroud)

Is …

bash pipe process-substitution exit-status

8
推荐指数
2
解决办法
2249
查看次数

标签 统计

bash ×1

exit-status ×1

pipe ×1

process-substitution ×1