I have this script myprogram
#!/bin/bash
echo This is the first one ${1}.
echo This is the second one ${2}.
and the input file test.txt
Hi
Hello
and I hope to use input redirection to run the script with input from test.txt, which should output
This is the first one Hi.
This is the second one Hello.
I'm trying to use
./myprogram < test.txt
but it's not working. The only thing it printed out is
This is the first one
This is the second one
Can anyone help me with it?