Subject: Re: Stupid question
To: None <marsmail@globegate.utm.edu>
From: Ken Nakata <kenn@remus.rutgers.edu>
List: port-mac68k
Date: 11/18/1997 10:25:51
On Tue, 18 Nov 1997 08:52:41 -0600 (CST),
"David A. Gatwood" <marsmail@globegate.utm.edu> wrote:
> On Mon, 17 Nov 1997, David Brownlee wrote:
>
> > On Mon, 17 Nov 1997, David A. Gatwood wrote:
> > >
> > > Yeah. In fact, rm \"-axl\" should work, too (quotes to indicate that it's
> > > not a flag, backslashes to keep the shell from removing the quotes when
> > > turning it into an argument. That might be shell-dependent, tho.
> > > Alternatively, ls *axl and if it's the only one, rm *axl.
> > >
> > Neither option will work - the first will try to remove a file
> > with a " as the first and last character, the latter is identical
> > to typing 'rm -axl', which is what started this thread.
>
> Dunno. The first one worked fine under linux... and upon trying it again,
That can't be the case. If it's really the case, Linux rm must be
nearly completely broken.
> it doesn't work.... I don't have a clue what's different.... Oh well....
rm \"-axl\" results in argv[] = { "rm", "\"-axl\"", NULL } upon
invocation. So rm will try to unlink a file named "-axl" (including
the double quotes), not plain -axl. Rm doesn't interpret quotes, you
know?
OTOH, rm *axl results in argv[] = { "rm", "-axl", NULL } (provided
that there's only -axl that matches the wild card), leading it to try
to interpret -axl as option switches. You'll end up with the same
result as rm -axl with this one.
Ken