[NTLUG:Discuss] the bash equiv worked like a champ!

Richard Geoffrion richard at rain.lewisville.tx.us
Sun Aug 26 01:10:37 CDT 2001


in my case I just issued for x in *; do rm -rf ../$x; done

Thanks!  I'll keep this command around.

----- Original Message -----
From: "Michael Patrick" <michael at techiesplace.com>
To: <discuss at ntlug.org>
Sent: Sunday, August 26, 2001 12:28 AM
Subject: Re: [NTLUG:Discuss] What's the bash equiv of the DOS for % in?


> Given:  Directory A is polluted by improper untarring.  Directory B
contains the contents of the tarball.
>
> I think you will find the following of use:
>
> cd directoryb ; for x in *; do rm -rf directorya/$x; done
>
> This got both files and subdirectories in my testing.
>
> Michael
>
> On Sat, Aug 25, 2001 at 11:04:28PM -0500, Richard Geoffrion wrote:
> > DOS:  for %i in (*.*) do del ..\%i
> >
> > English: For every instance of a file specified by the wildcard do
command
> > using that file
> >
> > I don't want to delete every file in that subdirectory...just the files
that
> > I extracted.  So...if I sit in a directory that contains JUST the files
that
> > came out of the tar and I issue the above DOS command...only I need the
> > LINUX version of it... I can automatically clean the files out of the
> > trashed up directory.
> >
> > *note.  If you use that command in a DOS batch file, you need to use
double
> > percent signs.
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>




More information about the Discuss mailing list