So I followed the solution here:command to zip multiple directories into individual zip filesand I added -er to the command however as I expected, I need to enter the password for every loop operation, i.e for every folder that gets zipped.How can I automate the password part? I want to use the same password for all zipped files.ThanksEDIT: It would be great if I can have all the output zip files created in another directory
Terminal - Zip multiple directories into separate zip files with password
shell script;password;zip
Instead of the -er flag, you could use the -P flag - it expects the password to follow.-P password   --password password          Use password to encrypt zipfile entries (if any).  THIS IS INSE-          CURE!   Many  multi-user  operating systems provide ways for any          user to see the current command line of any other user; even  on          stand-alone  systems  there  is  always  the threat of over-the-          shoulder peeking.  Storing the plaintext password as part  of  a          command  line  in  an  automated script is even worse.  Whenever          possible, use the non-echoing, interactive prompt to enter pass-          words.   (And  where  security  is  truly  important, use strong          encryption such as Pretty Good Privacy instead of the relatively          weak standard encryption provided by zipfile utilities.)Note it is insecure because the password is displayed on the command line and potentially viewable by others looking at the process tree.If that's not acceptable, look into using the expect utility.http://expect.sourceforge.net/