Automating textual input from a bash script without using EOF

view full story

http://unix.stackexchange.com – I'm running Ubuntu Linux. Suppose there is a program called myprogram. This program prompts the user for input; specifically, the user must type an integer when prompted and press Enter. I would like to automate this process using a bash script. In particular, I would like to execute myprogram, say, 100 times (using a counter i which goes from 1 to 100). On each execution of myprogram, I would like to enter the current value of i when prompted. (By the way, myprogram takes options/switches -options, all of which will be constant and thus specified within the bash script.) An incomplete (HowTos)