help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] How to terminate the main process when error arises in proce


From: Peng Yu
Subject: [Help-bash] How to terminate the main process when error arises in process substitution?
Date: Mon, 22 Apr 2013 16:40:06 -0500

Hi,

Since the function "error" return 1, I'd like the echo command
terminate with a non zero status code. Is it possible in bash?

~/linux/test/bash/man/shell_grammar/process_substitution/<($ ./main.sh
xx /dev/fd/63
0
~/linux/test/bash/man/shell_grammar/process_substitution/<($ cat main.sh
#!/usr/bin/env bash

function error {
echo Hello
return 1
}
echo xx <(error || exit $?)
echo $?


-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]