Revision 9534
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
122 | 122 |
function try() { e=0; benign_error=1 "$@" || { export_e; true; }; } |
123 | 123 |
alias try='declare e; "try" ' # last space alias-expands next word |
124 | 124 |
|
125 |
catch() { test "$e" -eq "$1"; e=0; }
|
|
125 |
catch() { test "$e" -eq "$1" && e=0; }
|
|
126 | 126 |
|
127 | 127 |
ignore() { catch "$@" || true; } |
128 | 128 |
|
Also available in: Unified diff
bugfix: lib/sh/util.sh: catch(): need && between test and e=0 so e=0 is only run if $e was equal to the desired value