We have moved to www.dataGenX.net, Keep Learning with us.

Tuesday, June 26, 2012

Twelve Methods to Parse a File Line by Line — Part 3


Source :  Mastering Unix Shell Scripting  




Method 7: 
cat $FILENAME | while LINE=$(line)
do
echo "$LINE"
done



Method 8: 
while LINE=$(line)
do
echo "$LINE"
done < $FILENAME



Method 9: 
exec 3<&0
exec 0< $FILENAME
while read LINE
do
echo "$LINE"
:
done
exec 0<&3



njoy the simplicity.......
Atul Singh