From 715086df2c8fa349a3ca48ab9dff6d5fc2ad94f0 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 10 May 2023 13:09:23 -0400 Subject: [PATCH] failcam minor: shellcheck warnings --- sysd-mail-once | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sysd-mail-once b/sysd-mail-once index d44b77f..3b87eea 100755 --- a/sysd-mail-once +++ b/sysd-mail-once @@ -55,7 +55,7 @@ shift c=$cbase/$service # c for command file path base -glob="$c[0-9]*" +glob="${c}[0-9]*" arr=($glob); file="${arr[0]}"; [[ $glob != "$file" ]] || file= [[ -d $cbase ]] || mkdir -p $cbase @@ -68,7 +68,7 @@ code=0 if (( code )); then send_mail=false if [[ $file ]]; then - i=${file#$c} + i=${file#"$c"} if (( i < errors )); then new_file=$c$((i+1)) mv $file $new_file @@ -90,7 +90,7 @@ To: $to From: $USER@$(hostname -f) Subject: $HOSTNAME: $service exit code: $code -$(journalctl -u $service.service --after-cursor=$(<$file)) +$(journalctl -u $service.service --after-cursor="$(<$file)") EOF fi else -- 2.30.2