Re: reading file line-by-line

1998-04-06 Thread Paul F Almquist
On Mon, Apr 06, 1998 at 06:28:23PM -0400, kgibson wrote: > > > > for line in `cat filename` > > do > > do_whatever_with $line > > done > > > > > > And just to test $line > > > > for line in `cat filename` > > do > > echo $line > > done > > You could run into trouble with either of the

Re: reading file line-by-line

1998-04-06 Thread kgibson
Isn't bash great! if that wasn't bash then I just made a fool of myself. --Kris Gibson--- ==-- _ / / \ ---==---(_)__ __ __/ / /\ \ --==---/ / _ \/ // /\ \/ / / /_/\ \ \ -=/_/_//_/\_,_/ /_/\_\

Re: reading file line-by-line

1998-04-06 Thread Rick L. Mantooth
for line in `cat filename` do do_whatever_with $line done And just to test $line for line in `cat filename` do echo $line done Rick On Mon, 6 Apr 1998, Niclas Domack wrote: > A (probably) stupid question from a shell-programming newbie.. > > I have got a long list of userna

Re: reading file line-by-line

1998-04-06 Thread Dave Wreski
> Here is a PERL way to do it: > > #!/usr/bin/perl > open(FILE, "filename"); > while($line = ) #grabs one line at a time until you get to eof Gad, I hate perl. Try bash: while read line do process $line done < filename -- PLEASE read the Red Hat FAQ, Tips, Errata and the MAILIN

Re: reading file line-by-line

1998-04-06 Thread Earle R Nietzel UNISYS
There is a great scripting language but it will take some time getting use to. It is called AWK It reads line by line and indexes all arguements on that line. Its really a great scripting tool once you become accustomed to it Earle Nietzel ==

Re: reading file line-by-line

1998-04-06 Thread redhat
Here is a PERL way to do it: #!/usr/bin/perl open(FILE, "filename"); while($line = ) #grabs one line at a time until you get to eof { process line . . . } close(FILE); Bryan Opfer On Mon, 6 Apr 1998, Niclas Domack wrote: > A (probably) stupid question from a shell-programming newbi