Thursday, 25 April 2013

Unix Shell Script - Read not working inside While Read

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 .

No comments:

Post a Comment