Revision 9029
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
70 | 70 |
|
71 | 71 |
# usage: try cmd...; ignore status; if catch status; then ...; fi; end_try |
72 | 72 |
|
73 |
function try () { "save_e_cmd" "$@" || true; }
|
|
73 |
function try () { e=0; "$@" || { save_e; true; }; }
|
|
74 | 74 |
alias try='declare e; try ' # last space alias-expands next word |
75 | 75 |
|
76 | 76 |
catch () { test "$e" -eq "$1"; e=0; } |
Also available in: Unified diff
lib/sh/util.sh: try (): use simpler save_e instead of save_e_cmd