Revision 8970
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/util.sh | ||
---|---|---|
33 | 33 |
# usage: try cmd...; ignore status; if catch status; then ...; fi; end_try |
34 | 34 |
|
35 | 35 |
try_ () { { "$@"; e="$?";} || true; } |
36 |
alias try='declare e; try_ ' # trailing space alias-expands next word
|
|
36 |
alias try='declare e; try_ ' # last space alias-expands next word
|
|
37 | 37 |
|
38 | 38 |
catch () { test "$e" -eq "$1"; e=0; } |
39 | 39 |
|
Also available in: Unified diff
lib/util.sh: say "last space" instead of "trailing space" so the comment will be more likely to fit at the end of the line