Discussion Locked

Password for zip in shell script

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I need to write a shell script and use the ZIP with -e option to encript ouput file.
(zip -e outputfile [inputfiles....] )
When using the the -e option the script stops and waits for my input of the password and its confirmation.
Is there any wayto write the script to add the password in the script and have the outpur file encripted?

-Fred

4 replies

by beermonster

I'm not familiar with the utility that you are using, but I'm a great fan of pkwares pkzip25 - supports long filenames, compatible with winzip etc, tons of switches and functionality AND allows you to specify the password on the command line ! The same exe zips and unzips so you can use it at either end of your zipping process. Check out
http://www.pkware.com/shareware/

Hope this helps...

by beermonster

PS, I did try the usual shell scripting tricks on a similar util before suggesting pkzip25 - zip < iput.inp (putting the password in an input file) and
echo password | zip, but couldn't get it to work....

This discussion is closed to new replies.