jacob23
December 20, 2006, 1:40am
1
Hi,
I need to execute the following unix command through my java code -
zip -e
When i execute this command from the command prompt, i am prompted for a password in the following manner -
Enter password:
Verify password:
Is it possible to provide the password inthe first command itself so that i am not prompted for it?
Any help in this regard will be highly appreciated!!
jacob23
December 20, 2006, 2:27am
2
Hi,
I just want a general approach for this problem for any unix command. That is, say any unix command on execution , prompts for some more info to be entered (say password in my case); how can i provide that additional info in the first command itself so that i can bypass the prompt for additional data.
Regards,
Jacob
system
December 20, 2006, 5:27am
3
Not sure about java, but you can do this with expect - http://expect.nist.gov/
vino
December 20, 2006, 5:46am
4
You could also try ksh's co-process. See the man pages of ksh to know more on co-process.
jacob23
December 20, 2006, 6:26am
5
Thanks for the reply.
Can you give some examples?
system
December 20, 2006, 9:36pm
6
Here's some expect script examples:
http://www.cpqlinux.com/expect.html
And here's my ftp ksh script that uses a co-process
All Unix, Linux and other Unix-like operating systems are families of computer operating systems derived from the original Unix System from AT&T Bell Laboratories. Today, the largest Unix descendent directly certified as UNIX is macOS by Apple....