From 526992f73b5fa1e5c710027601cca9cecec3bf5e Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 31 Dec 2022 13:34:22 +0100 Subject: [PATCH] fix shellcheck errors --- timeout | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/timeout b/timeout index 38267e7..1384ae4 100755 --- a/timeout +++ b/timeout @@ -31,11 +31,11 @@ check_pid() { PID=$1 LOOP=$2 - for i in $(seq 1 $LOOP); do + for i in $(seq 1 "$LOOP"); do test -d "/proc/$PID/" && sleep 1 || STATUS=0 done - kill -9 $PID + kill -9 "$PID" printf "%d" ${STATUS:-1} } @@ -64,9 +64,9 @@ main() { SCRIPT_PID=$(run_script "$SCRIPT_FILE") EXIT_STATUS=$(check_pid "$SCRIPT_PID" "$TIMEOUT") - stop_delete_script $PID "$SCRIPT_FILE" + stop_delete_script "$PID" "$SCRIPT_FILE" - exit $EXIT_STATUS + exit "$EXIT_STATUS" } trap on_interrupt INT