Interactive shell - Give answers to shell

Hi,

I have a script that calles some other scripts. Those scripts are expecting some inputs.

Right no I am typing manually. But now the number of questions from other scripts are too much and I want to give asnwers autimatically.

example.

Other scripts gives me 2 options
1) joom
2) aka

what to you want?------- (here I have to type joom or aka)
1) aaa
2) bbb
3) ccc
What do you want?-----(here i have to type my choice)

and this goes on for few times. Everytime the choices are same. So I want to automate this.

thanks for your help!

Have you seen: expect? It may help you with it!

A usefull link: Expect - Wikipedia, the free encyclopedia

If you don't know anything about expect, you can try: autoexpect -> autoexpect

1 Like

Interesting! I thought I could do it with shell script. Looks like I have to learn one more language :slight_smile:

Thanks for the info!