since this is my first post on this board i thought i would start by saying..."Hello".
I am trying to zip a directory of files using the below code.
for x in *; do if [ -d "$x" ]; then zip -r "$x.zip" "$x"; fi; done
I have a directory with multiple sub directories. in those sub-directories i have multiples files. if i place this script in the top directory it will create multiple zip files using the sub-directory's name. problem is that in the zip file it creates a directory of the sub-directory, i would rather not have this directory and just have the files alone. Looking at the man pages for zip I noticed a -D option but can not get this to work. can anyone help? if all this does not make sense i will try to explain further. thanks.