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