Bash problem

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Nathan England
Date:  
Subject: Bash problem
=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 -
> 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:

"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:

=2D----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

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