Revision 13245
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
295 | 295 |
sys_cmd() { cmd2sys; command "$@"; } # usage: sys_cmd cmd... # runs system cmd |
296 | 296 |
# allows running a system command of the same name as the script |
297 | 297 |
|
298 |
function sudo() { echo_func; self -E "$@"; } |
|
298 |
function sudo() |
|
299 |
{ |
|
300 |
echo_func |
|
301 |
if is_callable "$1"; then set -- env PATH="$PATH" "$@"; fi # preserve PATH |
|
302 |
self -E "$@" |
|
303 |
} |
|
299 | 304 |
alias sudo='"sudo" ' # last space alias-expands next word |
300 | 305 |
|
301 | 306 |
|
Also available in: Unified diff
bugfix: lib/sh/util.sh: sudo(): need to preserve PATH separately because -E does not preserve this