Twelve Methods to Parse a File Line by Line — Part 4(last)

Here we are continues the magic. You can find the part 1,2 & 3 here ….
Twelve Methods to Parse a File Line by Line — Part 1
Twelve Methods to Parse a File Line by Line — Part 2
Twelve Methods to Parse a File Line by Line — Part 3

Method 10:


function while_line_LINE_FD
{
exec 3<&0
exec 0< $FILENAME
while line LINE
do
echo “$LINE”
:
done
exec 0<&3
}

Method 11:


function while_LINE_line_cmdsub2_FD
{
exec 3<&0
exec 0< $FILENAME
while LINE=$(line)
do
print “$LINE”
:
done
exec 0<&3
}

Method 12:


function while_line_LINE_FD
{
exec 3<&0
exec 0< $FILENAME
while line LINE
do
echo “$LINE”
:
done
exec 0<&3
}


njoy the simplicity…….
©Mastering Unix Shell Scripting

Advertisements

About victimizeit
This is Atul.. working for IBM as a DataStage Developer. I may not be an expert on any particular DataStgae technology, but I'm sure I do know a few things about DB2, AIX, Unix, Windows, and DataBase. In this blog, I'll give out some tips on these subjects. If you find them useful, great, I'll be happy. Thanks for stopping by !!

What is your opinion ?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: