From 99a9034c5cdf3b54ff36913d74a65202aa18b47a Mon Sep 17 00:00:00 2001 From: sundowndev Date: Sun, 17 Mar 2019 17:09:29 +0100 Subject: [PATCH] Fix shellcheck errors --- covermyass.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/covermyass.sh b/covermyass.sh index 15d1c69..35506fc 100755 --- a/covermyass.sh +++ b/covermyass.sh @@ -111,18 +111,18 @@ function enableHistory () { } function clearLogs () { - for i in ${LOGS_FILES[@]} + for i in "${LOGS_FILES[@]}" do - if [ -f $i ]; then - if [ -w $i ]; then - echo "" > $i + if [ -f "$i" ]; then + if [ -w "$i" ]; then + echo "" > "$i" echo "[+] $i cleaned." else echo "[!] $i is not writable! Retry using sudo." fi - elif [ -d $i ]; then - if [ -w $i ]; then - rm -rf $i/* + elif [ -d "$i" ]; then + if [ -w "$i" ]; then + rm -rf "${i:?}"/* echo "[+] $i cleaned." else echo "[!] $i is not writable! Retry using sudo."