Computing.Net > Forums > Programming > How to read a file using unix script

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.

How to read a file using unix script

Reply to Message Icon

Name: ch Bushu
Date: April 27, 2009 at 02:39:49 Pacific
OS: Windows XP
Subcategory: General
Comment:

I have refernce file with some data in it

myfile:

aaaa
bbbb
cccc
dddd

and I have to write a script in unix such that for the first time the script has to take first line as a variabe or as an input and do spcifile task...and after finishing for the firt line it has to go for the second line and do the same tasks and same for the third line and fourth line also...


That reference file can be like below also:

myfile:

aaaa bbbb cccc dddd

Can somebody help me on this...I have very basic knowledge on unix scripting.... :-(

Thanks,



Sponsored Link
Ads by Google

Response Number 1
Name: ghostdog
Date: April 27, 2009 at 04:04:38 Pacific
Reply:

you can use a while read loop. Please read up the bash manual for info. Google for "Advanced Bash" and read the manual

Unix Win32 tools | Gawk for Windows


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 Programming Forum Home


Sponsored links

Ads by Google


Results for: How to read a file using unix script

How To delete a file uninstalled www.computing.net/answers/programming/how-to-delete-a-file-uninstalled/18405.html

How to read a file name automatica www.computing.net/answers/programming/how-to-read-a-file-name-automatica-/10790.html

How to create xls file using shell www.computing.net/answers/programming/how-to-create-xls-file-using-shell-/18530.html