Revision 8980
Added by Aaron Marcuse-Kubitza over 11 years ago
util.sh | ||
---|---|---|
42 | 42 |
|
43 | 43 |
# usage: try cmd...; ignore status; if catch status; then ...; fi; end_try |
44 | 44 |
|
45 |
try_ () { "save_e" "$@" || true; }
|
|
46 |
alias try='declare e; try_ ' # last space alias-expands next word
|
|
45 |
function try () { "save_e" "$@" || true; }
|
|
46 |
alias try='declare e; try ' # last space alias-expands next word |
|
47 | 47 |
|
48 | 48 |
catch () { test "$e" -eq "$1"; e=0; } |
49 | 49 |
|
Also available in: Unified diff
lib/util.sh: exceptions: try_ (): renamed to try () and use the function keyword to distinguish it from the alias