Revision 13267
Added by Aaron Marcuse-Kubitza over 10 years ago
util.sh | ||
---|---|---|
299 | 299 |
|
300 | 300 |
#### aliases |
301 | 301 |
|
302 |
unalias() { builtin unalias "$@" 2>&- || true; } # no error if undefined |
|
302 |
fi # load new aliases |
|
303 |
if self_being_included; then |
|
303 | 304 |
|
305 |
unalias() { self_builtin "$@" 2>&- || true; } # no error if undefined |
|
306 |
|
|
304 | 307 |
# usage: alias alias_='var=value run_cmd ' |
305 | 308 |
function run_cmd() { "$@"; } |
306 | 309 |
alias run_cmd='"run_cmd" ' # last space alias-expands next word |
... | ... | |
310 | 313 |
|
311 | 314 |
#### commands |
312 | 315 |
|
313 |
type() { (unalias "$1"; self_builtin "$1") || return; } # alias already expanded |
|
314 |
|
|
315 | 316 |
is_callable() { type -t "$1" >/dev/null; } |
316 | 317 |
|
317 | 318 |
is_extern() { test "$(type -t "$1")" = file; } |
Also available in: Unified diff
lib/sh/util.sh: unalias(): use self_builtin, which is now defined before it