In this series we
learn 12 methods to parse the file in Linux/Unix.
TwelveMethods to Parse a File Line by Line — Part 1
TwelveMethods to Parse a File Line by Line — Part 2
TwelveMethods to Parse a File Line by Line — Part 3
TwelveMethods to Parse a File Line by Line — Part 4
TwelveMethods to Parse a File Line by Line — Part 1
TwelveMethods to Parse a File Line by Line — Part 2
TwelveMethods to Parse a File Line by Line — Part 3
TwelveMethods to Parse a File Line by Line — Part 4
Method 1:
cat $FILENAME | while read LINE
do
echo "$LINE"
done
Method 2:
while read LINE
do
echo "$LINE"
done < $FILENAME
do
echo "$LINE"
done < $FILENAME
Method 3:
while line LINEdo
echo $LINE
done < $FILENAME
njoy the simplicity.......
Atul Singh