Revision 13196
Added by Aaron Marcuse-Kubitza almost 11 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
854 | 854 |
# command causes log_fd to be re-filtered, so that stderr is also filtered. |
855 | 855 |
# fd 2 is *not* redirected back to fd 2, to allow log-filtering out an |
856 | 856 |
# otherwise-confusing benign error. |
857 |
"$@" 2> >(command tee /dev/fd/"$log_fd") >&41 # redirects 2->{1,log_fd}
|
|
857 |
"$@" 2> >(log++ command tee /dev/fd/"$log_fd") >&41 #redirects 2->{1,log_fd}
|
|
858 | 858 |
} |
859 | 859 |
|
860 | 860 |
stdout_contains() |
861 | 861 |
# usage: { stderr2stdout cmd|stdout_contains echo_run grep ...; } 41>&1 |
862 |
{ echo_func; pipe_delay; pipe_delay; pipe_delay; "$@"|echo_stdout >/dev/null; } |
|
862 |
{ |
|
863 |
log_local; log++; echo_func |
|
864 |
pipe_delay; pipe_delay; pipe_delay; "$@"|echo_stdout >/dev/null |
|
865 |
} |
|
863 | 866 |
|
864 | 867 |
stderr_matches() # usage: pattern=... [ignore_e=#] stderr_matches cmd... |
865 | 868 |
{ |
866 |
log_local; log++; echo_func; kw_params pattern ignore_e; : "${pattern?}"
|
|
869 |
echo_func; kw_params pattern ignore_e; : "${pattern?}" |
|
867 | 870 |
if test "$ignore_e"; then local benign_error=1; fi |
868 | 871 |
|
869 | 872 |
# not necessary to allow callers to handle the error themselves (which would |
Also available in: Unified diff
bugfix: lib/sh/util.sh: stderr_matches(): `log_local; log++` should apply to just stdout_contains() and part of stderr2stdout() rather than all of stderr_matches()