commit 654efacdd90da0e256bb6205ac511ce15ff4f6bd
parent 4de19e8029d52b9095e5c77c80ab03f5e84631cd
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Wed, 3 Feb 2021 12:47:28 +0100
watch.sh: show non-zero return status
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.local/bin/watch.sh b/.local/bin/watch.sh
@@ -40,8 +40,12 @@ fi
host="${USER}@$(hostname):${PWD}"
while :; do
clear
- printf '%s (%ds) %s: %s\n' \
+ printf '%s (%ds) %s $ %s\n' \
"$(date '+%F %T')" "${wait}" "${host}" "$*"
eval "$@"
+ stat="$?"
+ if test "${stat}" -ne 0; then
+ printf 'return: %d\n' "${stat}"
+ fi
sleep "${wait}"
done