tj111 tj111 - 1 year ago 121
Linux Question

Have bash script answer interactive prompts

Is it possible to have a bash script automatically handle prompts that would normally be presented to the user with default actions? Currently I am using a bash script to call an in-house tool that will display prompts to the user (prompting for Y/N) to complete actions, however the script I'm writing needs to be completely "hands-off", so I need a way to send

to the prompt to allow the program to continue execution. Is this possible?

Answer Source

This is not "auto-completion", this is automation. One common tool for these things is called Expect.

You might also get away with just piping input from yes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download