Fix individual redirection with { cmd1; cmd2; }

Consider using { cmd1; cmd2; } >> file instead of individual redirects.
See : https://github.com/koalaman/shellcheck/wiki/SC2129
This commit is contained in:
Jeremy Gardais 2020-02-20 15:35:33 +01:00
parent b05d10771c
commit b589528e03
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 8 additions and 6 deletions

View File

@ -127,12 +127,14 @@ while IFS= read -r LINE; do
echo "${COLOR} $DISK ${TYPE}" echo "${COLOR} $DISK ${TYPE}"
echo "${COLOR} $DISK ${TYPE}" | cut -c2- >>/tmp/dres {
echo "" >>/tmp/dres echo "${COLOR} $DISK ${TYPE}" | cut -c2-
echo "$DRES" | grep -v -E "^smartctl|^Copyright|^$|^===" >>/tmp/dres echo ""
echo "------------------------------------------------------------" >>/tmp/dres echo "$DRES" | grep -v -E "^smartctl|^Copyright|^$|^==="
echo "" >>/tmp/dres echo "------------------------------------------------------------"
echo "" >>/tmp/dres echo ""
echo ""
} >>/tmp/dres
done < /tmp/dscan >/tmp/dcheck done < /tmp/dscan >/tmp/dcheck
# Set the global color according to the highest alert # Set the global color according to the highest alert