I admit this question was asked here before:
Like Zip into separate files where the person who asked didn't specify the OS he used and received no answers.
I need to separate a huge directory into multiple .zip files that are not interdependent on each other. So, instead of:
I would like the following set of files instead:
Basically this is my question. I'm on OS X so a shell script or AppleScript would be the easiest way to go.
In addition, here is a guy who asked the same thing – only he wanted to create a .tar archive: How to Creating separate archives for a set of files
The answer is correct, but it will result in tar files:
for file in `ls *`; do tar -czvf $file.tar.gz $file ; done
PS: This last part is just for those of you who are fit in Keyboard Maestro:
I also tried to perform this in Keyboard Maestro, I have a "for each" action setup which determines the file paths and then triggers a shell script. The output is correct and the macro works if I paste it in the terminal (e.g.
However, when I pass the two variables to the shell script in Keyboard Maestro won't work:
zip "$KMVAR_zipPath" "$KMVAR_sourcePath"