Revision 12206
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
718 | 718 |
# exit status of cmd is placed in $e for use with exception handling |
719 | 719 |
{ |
720 | 720 |
echo_func; kw_params pattern; : "${pattern?}" |
721 |
local PIPESTATUS_ |
|
722 | 721 |
"try" stderr2stdout "$@"|"try" stdout_contains echo_run grep -E "$pattern" |
723 |
PIPESTATUS_=("${PIPESTATUS[@]}") # save because it's reset after each cmd
|
|
722 |
local PIPESTATUS_=("${PIPESTATUS[@]}") # save b/c it's reset after each cmd
|
|
724 | 723 |
e="${PIPESTATUS_[0]}" # 1st command's exit status -> $e |
725 | 724 |
return "${PIPESTATUS_[1]}" # 2nd command's exit status -> $? |
726 | 725 |
} |
Also available in: Unified diff
lib/sh/util.sh: stderr_matches(): actually don't need to declare PIPESTATUS_ in a separate command, because local does support arrays