diff options
author | Kurt J. Bosch <kjb-temp-2009@alpenjodel.de> | 2011-07-03 19:36:29 +0200 |
---|---|---|
committer | Kurt J. Bosch <kjb-temp-2009@alpenjodel.de> | 2011-07-10 18:22:37 +0200 |
commit | 834d47fedd68a5adbd6152649363d99b6ad642b4 (patch) | |
tree | cd7b52193984f92dd0781c81bca7b9f29ae91d19 /functions | |
parent | ed0a943cc9762a1ccaf38bd3c36c31bf56f60fd9 (diff) |
functions: Make status() return the actual exit code
The exit code returned by the given command might be useful/expected, so don't discard but return it.
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -156,12 +156,10 @@ stat_die() { status() { stat_busy "$1" shift - if "$@" &>/dev/null; then - stat_done - return 0 - fi - stat_fail - return 1 + "$@" &>/dev/null + local ret=$? + (( $ret == 0 )) && stat_done || stat_fail + return $ret } # usage : in_array( $needle, $haystack ) |