The problem here is that you are trying to read both the text file and the user input from
standard input. You have to separate them in some way. One idea is to assign a file descriptor to the text file and leave the standard input for user input, e.g.
Code:
#!/bin/bash
exec 3<>$1
while read -u 3 LINE; do
echo -n "Enter your name: "
read MYNAME
done
In this example the file descriptor 3 is assigned to the text file passed as argument to the script itself, while the user input comes from file descriptor 0 (standard input). You have to execute the script as in:
Code:
./name_of_the_script name_of_text_file
without the
< redirection