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
Isn't bash great!
if that wasn't bash then I just made a fool of myself.
--Kris Gibson---
==-- _ / / \
---==---(_)__ __ __/ / /\ \
--==---/ / _ \/ // /\ \/ / / /_/\ \ \
-=/_/_//_/\_,_/ /_/\_\
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
> 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
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
==
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