Fixed missing double quotes using ShellCheck
This commit is contained in:
parent
eac1527d49
commit
af79f3ae21
1 changed files with 7 additions and 7 deletions
|
|
@ -31,7 +31,7 @@ usage () {
|
|||
dir_list () {
|
||||
echo "-Folder $1-"
|
||||
|
||||
for FILE in $1/* # Loop over the files in the folder given as first arg
|
||||
for FILE in "$1"/* # Loop over the files in the folder given as first arg
|
||||
do
|
||||
echo "Scanning: $FILE"
|
||||
|
||||
|
|
@ -39,11 +39,11 @@ dir_list () {
|
|||
if [[ -d "$FILE" ]]; then
|
||||
# If it is we loop over its content
|
||||
echo "$FILE is actually a directory !"
|
||||
dir_list $FILE $2
|
||||
dir_list "$FILE" "$2"
|
||||
else
|
||||
echo "$FILE is not a directory ! Adding it to the list"
|
||||
# Writing the file in the output list
|
||||
echo $FILE >> $2
|
||||
echo "$FILE" >> "$2"
|
||||
fi
|
||||
done
|
||||
echo "-----------------------------------------------"
|
||||
|
|
@ -62,10 +62,10 @@ else
|
|||
echo "$2 exists, backing it up to $2.old"
|
||||
if [ -f "$2.old" ]; then
|
||||
echo "$2.old exists already ! Deleting it"
|
||||
rm $2.old
|
||||
rm "$2".old
|
||||
fi
|
||||
mv $2 $2.old
|
||||
mv "$2" "$2".old
|
||||
fi
|
||||
touch $2
|
||||
dir_list $1 $2
|
||||
touch "$2"
|
||||
dir_list "$1" "$2"
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue