Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 11th September 2008
PatrickBaer PatrickBaer is offline
Fdisk Soldier
Join Date: May 2008
Posts: 81
Thanked 1 Time in 1 Post
Default `cat problem`

Hi all,

I want to write a script processing each line in a file.

for i in `cat blah.txt`
echo $i

there is some way to keep it from treating the file as a single line, but I can't remember. I think it was about some double quotes, but where?
Reply With Quote
  #2   (View Single Post)  
Old 11th September 2008
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 336
Thanked 32 Times in 30 Posts

cat blah.txt | while read line
echo $line
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot problem. Geometry problem? gulanito FreeBSD Installation and Upgrading 0 3rd July 2009 03:03 AM

All times are GMT. The time now is 08:27 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick