[Techtalk] Really dumb filename question...
Diggy Bell
diggy at dbsoftdev.com
Tue Aug 26 08:18:15 EST 2003
Voila!
Thanks Mandi, that did it! I'm now hanging my head in shame for missing
that in the man page.
Diggy
----- Original Message -----
From: "Mandi" <mandi at linuxchick.org>
To: "Diggy Bell" <diggy at dbsoftdev.com>
Cc: <techtalk at linuxchix.org>
Sent: Tuesday, August 26, 2003 8:00 AM
Subject: Re: [Techtalk] Really dumb filename question...
> > I was trying to package up some files this morning and typed something
> > similar to this:
> >
> > tar czf --exclude=`*.php' --exclude='*.html' sourcedir
> >
> > If you're more awake than I was, you'll realized that I probably forgot
to
> > put a file name in there. You probably also realized that I now have an
> > archive named '--exclude=*.exe'. Ooops!
> >
> > Ok, so that was a simple enough mistake that should be easily corrected,
> > right? I can't seem to figure out the magic escape sequence to get any
> > thing to treat it as a filename instead of a commandline parameter.
> >
> > My first thought was wildcards, but it doesn't like that at all.
> >
> > rm *.pdf <failed>
> > rm \-* <failed>
> >
> > The same goes for any other combination I could think of. I even tried
> > rm -rf sourcedir!
>
> magical double hyphen
>
> rm -rf -- --exclude=*.3
>
> >From the rm manpage:
> GNU rm, like every program that uses the getopt function
> to parse its arguments, lets you use the -- option to
> indicate that all following arguments are non-options. To
> remove a file called `-f' in the current directory, you
> could type either
> rm -- -f
> or
> rm ./-f
>
> Other unixy rm's use the mystical single hyphen that predates the
> enlightenment of getopt.
>
> HTH
>
> --mandi
>
>
More information about the Techtalk
mailing list