Computing.Net > Forums > Linux > Read file line by line - Shell Scr

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Read file line by line - Shell Scr

Reply to Message Icon

Name: Sanjay
Date: September 23, 2002 at 14:28:04 Pacific
OS: Linux
CPU/Ram: Pentium
Comment:

Hi,

Can anyone tell me how to read a text file line by line in a shell prog?



Sponsored Link
Ads by Google

Response Number 1
Name: Mark
Date: September 23, 2002 at 15:47:57 Pacific
Reply:

Hi-

Try this

cat somefile | while read line
do
something $line
done

I think this will work

-Mark


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Read file line by line - Shell Scr

How to read 1 line from text file www.computing.net/answers/linux/how-to-read-1-line-from-text-file/15725.html

go through a file line by line? www.computing.net/answers/linux/go-through-a-file-line-by-line/24907.html

Script for read files in a director www.computing.net/answers/linux/script-for-read-files-in-a-director/28504.html