Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read text file using while? 2

Status
Not open for further replies.
May 29, 2003
40
US
Hello all,
i have a text file containing some lines.
Using shell script i want to read line after line then doing couple of things in every cycle of the loop untill the file will get to its end.
i would appreciate if someone could show me some simple way to do this using "while".
thanks allot.
 
This should work...
Code:
#!/bin/ksh

while read LINE
do
   # Do something with ${LINE}
   print "Line is: ${LINE}"
done < infile.txt
Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top