Mail Archives: djgpp/2002/05/24/15:15:03
DJ Delorie wrote:
>
> > : bash-2.04$ rm -fv @foo
> >
> > I have myself been bitten by this.
> >
> > Is there any good reason why a non-existent file shouldn't
> > produce a warning?
>
> If you use the "-f" option of rm, it silences warnings.
>
> What djgpp does is look to see if @foo means a file foo. If
> the file foo doesn't exist, the whole @foo is passed to the
> program as-is (that allows you do to do things like "grep
> @PATH@ Makefile.in"). If the program doesn't warn about
> invalid parameters, it will go unnoticed.
Which means that "rm @foo" cannot mean to remove the file "@foo",
because if it exists it is an extended command line, and if it
doesn't it becomes an argument. So, at least for rm, that usage
makes no sense. For other programs it is another matter.
As long as the usage is engrained in the DJGPP system, it should
not be changed. However I suggest that the faq should be
enhanced, because this looks like a pretty good gotcha.
BTW a thought occurs to me - if the @ mechanism is to effectively
extend command lines, what is the effect of multiple @ in a single
command, e.g. "rm @foo @bar"? If I remember maybe I will try it
later with "echo @foo @bar", after building some foo and bar
files. First I will have to make a DJGPP echo command, with a
different name.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!
- Raw text -