Revision 8889
Added by Aaron Marcuse-Kubitza almost 12 years ago
lib/util.sh | ||
---|---|---|
18 | 18 |
# this is needed because aliases defined inside an if statement are not |
19 | 19 |
# available inside that if statement |
20 | 20 |
|
21 |
unalias () { builtin unalias "$@" 2>&- || true; } # no error if undefined |
|
22 |
|
|
23 | 21 |
if self_not_included "${BASH_SOURCE[0]}"; then |
24 | 22 |
|
25 | 23 |
shopt -s expand_aliases |
26 | 24 |
|
25 |
unalias () { builtin unalias "$@" 2>&- || true; } # no error if undefined |
|
26 |
|
|
27 | 27 |
#### exceptions |
28 | 28 |
|
29 | 29 |
# usage: try cmd...; ignore status; if catch status; then ...; fi; end_try |
Also available in: Unified diff
lib/util.sh: moved unalias inside include guard since it is not needed by anything before the include guard (even though it is used by commands outside the include guard, i.e. when the include guard is temporarily closed and reopened to load/unload aliases)