Hi friends,
I'm using this script to compress a folder in a directory. I found that
script only suitable for a folder name which not containing space (eg freelancers).
But it won't work if this folder name is containing a space (free lancers). I would like to make this script more flexible, no matter what kind of folder name, it also work. So do you all have any idea? Thank you!!
for folder in *
do
# Compress any folder found in the directories
if [ -d $folder ]
then
tar zcvf $folder.tgz $folder
rm -r $folder
else
echo “No folder was found,program is exiting..................”
fi
done
