aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-03-18 11:36:00 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-03-18 11:36:00 -0500
commit82897e57865eb154947dc490d613a0f23cfc3bdd (patch)
treea812e3b6daa148e584c2a76bf020b5c7be2aa2f8
parentbbf8c8d4222a70ea1228f0ec974c6e2f0510f5b2 (diff)
return retval rather than 0. Maybe better to return the actual return value after the wait.
-rw-r--r--spinner.sh4
1 files changed, 2 insertions, 2 deletions
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