From 82897e57865eb154947dc490d613a0f23cfc3bdd Mon Sep 17 00:00:00 2001 From: William Harrington Date: Thu, 18 Mar 2021 11:36:00 -0500 Subject: return retval rather than 0. Maybe better to return the actual return value after the wait. --- spinner.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spinner.sh') diff --git a/spinner.sh b/spinner.sh index 4965d8f..7a2c874 100644 --- a/spinner.sh +++ b/spinner.sh @@ -15,11 +15,11 @@ spinner() { printf '\033[s\033[u[ \ ] %s\033[u' "$str"; sleep "$delay" printf '\033[s\033[u[ | ] %s\033[u' "$str"; sleep "$delay" done - wait $PROC + wait ${PROC} retval=$? printf '\033[s\033[u%*s\033[u\033[0m' $((${#str}+6)) " " # return to normal tput cnorm # restore cursor - return 0 + return $retval } export -f spinner \ No newline at end of file -- cgit v1.2.3-54-g00ecf