Hie Friends,
I need your help once again.
I have 77 �password protected� winzip files in linux/unix server. I want to decrypt it through an automated script. Password of every file is same and it is mhd*tt.
Please help me.
Usually I unzip it as follows, manually one by one.
unzip <file name>
Then it asks for password.
Please help me in automating it.
Thank you
Anushree
Try this:
$ cat password.file
mhd*tt
$ for file in `ls *.zip` ; do unzip $file < password.file ; done
Hi friends,
Thank yo ufor the reply.
I have tried it as follows
cat password.file
mhd*tt
for file in `ls *.zip`
do
unzip $file < password.file
done
but its givinf following error, I think its asking for mannual intervetion.
$ sh test.sh
Archive: 2009_12.zip
[2009_12.zip] 2009_12.txt password:
Please advice.
Thank you, regards
Anushree
This should work.
unzip -P password filename
pludi
January 18, 2010, 2:24am
5
InfoZIP's unzip has the -P parameter:
-P password
use password to decrypt encrypted zipfile entries (if any). THIS IS INSECURE! 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 passwords. (And where security is truly important, use strong encryption such as Pretty Good Privacy instead of the relatively weak encryption provided by standard zipfile utilities.)
Check with the man page of your unzip to see if it offers a similar capability.
If not, you have this funzip which seems to have -password option.
funzip [-password] [input[.zip|.gz]]
Hi The Greek,
funzip option worked.
Thank you all very much for your help.
Anushree.