When I am writing a shell script, I have a problem about nested read as the following codes.
while read entry
do
IFS=' ' read -a array <<< "$entry"
read -p "Read from keyboard" keyin
case $keyin in
[a]* ) .....
.....
esac
done << file
I expected to read keyboard input but the 'read -p .... keyin' always read value from 'file'. Is anyone have idea about this? Any alternative method for me to read keyboard input in this situation?
Thanks.
bash? If so, say so (otherwise you might be asking about Korn shell orzshor Dash instead, or as well). Add the tag and say so in the question.