Project

General

Profile

« Previous | Next » 

Revision 11857

bugfix: lib/sh/util.sh: stderr2stdout() use `command` before tee, which re-filters log_fd so that stderr itself is also filtered. this allows log-filtering out an otherwise-confusing benign error when using e.g. stderr_matches().

View differences:

util.sh
690 690
alias filter_fd='"filter_fd" ' # last space alias-expands next word
691 691

  
692 692
stderr2stdout() # usage: stderr2stdout cmd... # unlike `2>&1`, logs stderr
693
{ echo_func; "$@" 2> >(echo_run tee /dev/fd/"$log_fd"); }
693
{
694
	echo_func
695
	# command causes log_fd to be re-filtered, so that stderr is also filtered.
696
	# this allows log-filtering out an otherwise-confusing benign error.
697
	"$@" 2> >(command tee /dev/fd/"$log_fd")
698
}
694 699

  
695 700
stdout_contains() # usage: stderr2stdout cmd|stdout_contains echo_run grep ...
696 701
{ echo_func; pipe_delay; pipe_delay; "$@"|echo_stdout >/dev/null; }

Also available in: Unified diff