delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/05/24/15:15:03

Message-ID: <3CEE7DCE.BD8CACAE@yahoo.com>
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: GNU Pascal (gpc) 2.1 released
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1020523191611 DOT 3394B-100000 AT is> <3CED528D DOT 7DCF9660 AT yahoo DOT com> <3CED6BA6 DOT 48D4D0FE AT phekda DOT freeserve DOT co DOT uk> <ackpus$4e5$1 AT antares DOT lu DOT erisoft DOT se> <200205241404 DOT g4OE4Qt03777 AT envy DOT delorie DOT com>
Lines: 39
Date: Fri, 24 May 2002 19:00:56 GMT
NNTP-Posting-Host: 12.90.172.110
X-Complaints-To: abuse AT worldnet DOT att DOT net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1022266856 12.90.172.110 (Fri, 24 May 2002 19:00:56 GMT)
NNTP-Posting-Date: Fri, 24 May 2002 19:00:56 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019