开发者

BASH scripting : Command result and pipeline [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

unix shell, getting exit code with piped child

is it possible to have the result of a command (what's usually in $? variable) which is at the beginning of a pipeline ?

eg :

rm -rf filename_to_delete | tee -a log_filename

$? would contai开发者_运维问答n the exit value of the tee statement, how can I have the exit value of the rm statement ?


How do I get the exit code of cmd1 in cmd1|cmd2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜