From 1b99492c61002f4038ce2cf37b63b26c6b4b1e5b Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 22 Jan 2016 21:04:43 -0500 Subject: run_cmd(): Return command's exit status --- (limited to 'src') diff --git a/src/cmd.sh b/src/cmd.sh index a42744d..e50b870 100644 --- a/src/cmd.sh +++ b/src/cmd.sh @@ -108,6 +108,7 @@ run_cmd() { local cmd="${1}" local cmd_clean= + local es= shift cmd_clean="$(printf '%s' "${cmd}" | \ @@ -116,6 +117,7 @@ run_cmd() running_cmd="${cmd}" running_cmd_clean="${cmd_clean}" "cmd_${cmd_clean}_main" "${@}" + es=${?} running_cmd='' running_cmd_clean='' else @@ -123,5 +125,5 @@ run_cmd() return 1 fi - return 0 + return ${es} } -- cgit v0.9.1