Hi I am trying to create a bash program to call a program and input menu picks into it.
For example my program runs
Hello world:
1) Item 1
2) Item 2
Enter : 2
Item 2 Menu
1) sub Item A
2) sub item B
enter: 1
I tried doing $ 2|1|./program and $./program|2|1
But it either fails or it just loops forever and doesn’t get to the second menu.
Is it possible to do this?
Presuming a program that works essentially like this one:
Then you can just say
For anything less straightforward you may need to learn
expect, which is designed for this sort of thing.