配列内のファイルとディレクトリの組み合わせを最適に処理するにはどうすればよいですか。ファイルとフォルダーの配列を作成し、配列をループして、配列内の各アイテムに-rfオプションを指定したrmコマンドを実行する必要があります。
#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