Project

General

Profile

« Previous | Next » 

Revision 9730

lib/sh/util.sh: echo_redirs_cmd(): added $cmd_name_log_inc kw param to allow echoing the command name at a different log_level than the command output

View differences:

util.sh
431 431

  
432 432
echo_eval() { echo_params; builtin eval "$@"; }
433 433

  
434
# usage: redirs=(...); echo_redirs_cmd
434
# usage: redirs=(...); [cmd_name_log_inc=#] echo_redirs_cmd
435 435
function echo_redirs_cmd()
436 436
{
437
	local cmd_name_log_inc="${cmd_name_log_inc-0}"
438
	
437 439
	# print <>file redirs before cmd, because they introduce it
438
	echo_cmd "$@" $(
440
	"log+" "$cmd_name_log_inc" echo_cmd "$@" $(
439 441
		set -- "${redirs[@]}" # operate on @redirs
440 442
		while test "$#" -gt 0 && starts_with '[<>][^&]' "$1"
441 443
		do log "$1 \\"; shift; done # log() will run *before* echo_cmd itself

Also available in: Unified diff