From: Ian Kelling Date: Wed, 10 May 2023 17:09:23 +0000 (-0400) Subject: failcam minor: shellcheck warnings X-Git-Url: https://iankelling.org/git/?a=commitdiff_plain;h=715086df2c8fa349a3ca48ab9dff6d5fc2ad94f0;p=log-quiet failcam minor: shellcheck warnings --- 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