How do I best handle a mix of files and directories in an array. I need to create an array of files and folders and loop through the array and subject each item in the array to the rm command with the -rf options:
#Build array of files to be deleted
FILES=(
"~/Library/Preferences/Adobe InDesign"
"~/Library/Caches/Adobe InDesign"
"~/Library/Saved Application State/com.adobe.InDesign.savedstate"
)
#Loop through array deleting each file/directory with the recursive force options
for i in "${FILES[@]}"
do
rm -rf "$i"
done
exit
set -vxwill show you how your command is being processed. I bet you don't want dbl-quotes around${FILES[@]}. Good luck.echoin front ofrmand edit your post with the output? Loosing your mind, that's not good. Oh hey, I had a crazy spot yesterday, I had imported a shell script with \r\n (DOS) line endings andvimdidn't show the^Mthat I would expected AND the results were completely mystifying.cat -vet myScriptto eliminate this possibility. Good luck.