Project

General

Profile

« Previous | Next » 

Revision 9134

lib/sh/util.sh: command(): support ensuring errors are visible by redirecting them to fd 22 (global stderr) when $stderr_is_errors is set

View differences:

lib/sh/util.sh
206 206

  
207 207
## external commands
208 208

  
209
function command() { builtin command -- "$@"; }
209
function command() # usage: [stderr_is_errors=1] command extern_cmd...
210
{
211
	set -- -- "$@" # prepend -- so command name not treated as `command` option
212
	set -- builtin command "$@"
213
	if test "$stderr_is_errors"; then "$@" 2>&22 # ensure errors are visible
214
	else "$@"; fi
215
}
210 216

  
211 217
alias echo_run_prep='cmd2rel_path; echo_cmd "$@"; cmd_indent'
212 218

  

Also available in: Unified diff