Jun 18, 2005 #1 redsss Programmer Mar 17, 2004 72 US There is a command that prompts 4 times for user input, and at each prompt, I hit enter. how can I automate that in a script?
There is a command that prompts 4 times for user input, and at each prompt, I hit enter. how can I automate that in a script?
Jun 18, 2005 #2 PHV MIS Nov 8, 2002 53,708 FR Perhaps something like this: echo "\n\n\n\n" | yourCommand Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
Perhaps something like this: echo "\n\n\n\n" | yourCommand Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
Jun 18, 2005 #3 Salem Programmer Apr 29, 2003 2,455 GB For more complex tasks, there is a tool called expect. [tt] expect ? programmed dialogue with interactive programs[/tt] -- Upvote 0 Downvote
For more complex tasks, there is a tool called expect. [tt] expect ? programmed dialogue with interactive programs[/tt] --
Jun 19, 2005 Thread starter #4 redsss Programmer Mar 17, 2004 72 US Well for a simple script echo doesn't seem to work (this is on Linux, which doesnt include expect) Code: #!/bin/sh echo in: read INPUT echo out: read OUTPUT echo you entered $INPUT and $OUTPUT echo "2\n4\n" doesnt work. but printf "2\n4\n" works. But printf doesnt work for the executable I need it to work with, which is openssl. Upvote 0 Downvote
Well for a simple script echo doesn't seem to work (this is on Linux, which doesnt include expect) Code: #!/bin/sh echo in: read INPUT echo out: read OUTPUT echo you entered $INPUT and $OUTPUT echo "2\n4\n" doesnt work. but printf "2\n4\n" works. But printf doesnt work for the executable I need it to work with, which is openssl.