Bash script for reading output of linux command and make input
Hello,
How can I make an bash script which makes an "openssl" command, and when the "openssl" command ask's a quiestion, the bash script automaticly make a response. Example, I run "openssl ..." and it ask for my hostname - how do I automate this response with bash script. I tried googleing it, but no luck... :( |
this is what expect was created for but i suspect there is a more graceful way of providing openssl the info it needs via commandline arguments.
|
Try this page for openssl examples http://www.madboa.com/geek/openssl/#cs-smtp
|
Quote:
|
Quote:
|
^ never used openssl but judging by the name it uses some sort of key based authentication. I was merely suggesting to the op that it would probably be more practical to use the built-in parameters of the command rather than kludge something together with expect.
|
Quote:
|
Quote:
|
Quote:
You USED to be able to change pointers in the argv vector and change what was visible... but that no longer works as what the user process gets is a COPY of the parameters, not the original (kernel/user separation). Even when it worked, the parameters were visible for a time. |
All times are GMT -5. The time now is 02:44 PM. |