TECH SOLUTIONS

Click here to edit subtitle

Forums

Post Reply
Forum Home > Unix Learnings > [SOLVED] Unix - Read not working inside While Read

Sourav Gulati
Site Owner
Posts: 83

If you want to read some input inside while read lline loop , it can be done as follows:

while read line

do

line=`echo $line`

echo "Enter choice"

read choice</dev/tty

echo "$choice" " " "$line"

done<filename


read does not work under while because we have already used "read" in reading line from a file .

 

 


--


January 9, 2013 at 4:08 AM Flag Quote & Reply

You must login to post.