Project

General

Profile

« Previous | Next » 

Revision 10063

lib/sh/util.sh: added sys_cmd_path() and use it in cmd2sys

View differences:

lib/sh/util.sh
121 121

  
122 122
#### commands
123 123

  
124
sys_cmd_path() { echo_func; echo_builtin command -p which "$1"|echo_stdout; }
125

  
124 126
# makes command in $1 a system command
125 127
# allows running a system command of the same name as the script
126 128
alias cmd2sys="$(cat <<'EOF'
127 129
declare _1="$1"; shift
128
_1="$(indent; log++; echo_builtin command -p which "$_1"|echo_stdout)" || return
130
_1="$(indent; clog++ sys_cmd_path "$_1")" || return
129 131
set -- "$_1" "$@"
130 132
EOF
131 133
)"

Also available in: Unified diff