Doing this is a security risk, as it means that your password will be written in text form in your script.
For this reason, zip refuses to work this way. He wants to enter from the keyboard, not your script or file.
I don't know about a workaround.
On the other hand, at least zip in my Ubuntu distribution offers the -P password option, which I think allows you to enter the password directly on the command line. Documentation surrounds this parameter with appropriate warnings.
source share