Add -r parameter for _command function

This commit is contained in:
Evgeny Sinelnikov 2022-04-08 06:06:57 +04:00
parent 0b76600565
commit 022b96c71d

View File

@ -32,11 +32,16 @@ _command()
{
local retval=0
local x=
local p='$'
if test "$1" = '-x'; then
shift
x=1
fi
color_message "\$ $*" bold
if test "$1" = '-r'; then
shift
p='#'
fi
color_message "$p $*" bold
test -z "$x" || echo -------------------------------------------------------------------------------
$* || retval=$?
test -z "$x" || echo -------------------------------------------------------------------------------
@ -59,7 +64,7 @@ run_by_root()
else
test -z "$msg" ||
echo -n "$msg: "
_command $* || return 1
_command -r $* || return 1
fi
}