X-Git-Url: https://iankelling.org/git/?p=log-quiet;a=blobdiff_plain;f=sysd-mail-once;fp=sysd-mail-once;h=3b87eea08dbc7c4f399786d4ce5dc4ecaab84adc;hp=d44b77fd48f35c0405be838fc20052b99604ae6f;hb=715086df2c8fa349a3ca48ab9dff6d5fc2ad94f0;hpb=5331574c85febd243afa415c2a1fad9ad3c63e59 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