Bash problem

Nathan England plug-discuss@lists.plug.phoenix.az.us
Sun, 2 Feb 2003 11:34:41 -0700


=2D----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No kidding! ha ha... that helps a lot!
So I don't need to post my next question..
Thanks George!

nathan


Am Sonntag 02 Februar 2003 07:54 vormittags schrieb George Toft:
> Kevin Brown wrote:
> > > I have a large text file with a bunch of names in it.
> > >
> > > Is there an easy way to have a script grep each name out of the file
> > > and do something with it?
> > >
> > > Like create a variable from each name with the name as the value?
> > > Or check to make sure that name is a folder somewhere else?
> >
> > something like:
> >
> > for p in `cat file`
> > do
> > echo $p
> > done
> >
> > (add dir checking in place of echo $p).
> >
> > for p in `cat file`
> > do
> > if [ ! -e "$p" ]
> > then
> >         `mkdir $p`
> > else
> >         if [ ! -d "$p" ]
> >                 echo "Not a Directory, but file by $p name exists here"
> >         fi
> > fi
> >
> > Or something similar.
> >
> > ---------------------------------------------------
>
> If the file is too big (>4K, I think), the for loop will bomb.  Try
> this:
>
> while read LINE; do
> 	# Do something with LINE
> done < file
>
>
> George
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change  you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

=2D --=20
Nathan England

Arcanum Linux !
nathan at the-arcanum.org
jabber id: linuxjunkie@jabber.earth.li

"A free society is one where it is safe to be unpopular."
=2D --Adlai Stevenson


Registered Linux User #189789, Machine #106603
www.sincerechoice.org

Spam related material will be forwarded to:
uce@ftc.gov
=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+PWTEQ7yNnsYcupwRArLZAKCuizP0R2hOB8d4HcdIrzIEHlKpWwCgkbnT
i2tRriyUaPNcYUsxkEWdt/M=3D
=3Dq4X4
=2D----END PGP SIGNATURE-----