Want to protect my ZIP archive with password.
Create archive with this:
zip -er archivename.zip file
and get this:
Enter password:
Verify password:
Everything is ok,but I have variable with password and need to send this password to zip. Tried through arguments like this, but failed.
echo "$1"| zip -er archivename.zip file
Is it possible in bash? Because zip utility does not support stdin.
For insecure solution, use -P:
-P|--password password Use password to encrypt zipfile entries (if any). THIS IS INSECURE!
-e|--encrypt Encrypt the contents of the zip archive using a password which is entered on the terminal in response to a prompt
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With