[opensuse] BASH Help -- howto provide automatic input to program called in script?
Listmates (also cc'ed to dnh) How do I provide a response to a program called from within a script from within the script itself? Sort of like a password chat program waiting on the prompt? Specifically, I have automated setting up a self signed server certificate for apache2 calling openssl from the script: # Generating Private Server Key openssl genrsa -des3 -out server.key 1024 # Generate Certificate Signing Request (CSR) openssl req -new -key server.key -out server.csr # Remove Passphrase from Key echo -e "\n\t${lightblue}Removing Passphrase From Key To Eliminate PW Request cp server.key server.key.protected openssl rsa -in server.key.protected -out server.key Each of the openssl requests ask either to create a password or to enter a password. Is the chat program the best solution? -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Hello, On Thu, 05 Feb 2009, David C. Rankin wrote:
How do I provide a response to a program called from within a script from within the script itself? Sort of like a password chat program waiting on the prompt? Specifically, I have automated setting up a self signed server certificate for apache2 calling openssl from the script:
If feeding it via stdin doesn't suffice, use 'expect'. -dnh -- Check it out, send me comments, and dance joyously in the streets, -- Linus Torvalds announcing 2.0.27 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David Haller wrote:
Hello,
On Thu, 05 Feb 2009, David C. Rankin wrote:
How do I provide a response to a program called from within a script from within the script itself? Sort of like a password chat program waiting on the prompt? Specifically, I have automated setting up a self signed server certificate for apache2 calling openssl from the script:
If feeding it via stdin doesn't suffice, use 'expect'.
-dnh
Ahh, Seems there is a new species of animal called expect? expect/send/send_user/exp_continue new syntax pretty cool. Thankfully, since the openssl prompts are known the here document approach was just the ticket -- as long as they don't change the openssl prompts. Thanks David & Aaron. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
How do I provide a response to a program called from within a script from
If feeding it via stdin doesn't suffice, use 'expect'.
Ahh,
Seems there is a new species of animal called expect?
No it's ooooold. But everything is new to each person at some point :) There are still Heinlein books that I am carefully preserving as new-to-me, so that, yay for me, I still have "new" Heinlein to read some day! -- Brian K. White brian@aljex.com http://profile.to/KEYofR +++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++. filePro BBx Linux SCO FreeBSD #callahans Satriani Filk! -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (3)
-
Brian K. White
-
David C. Rankin
-
David Haller