delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/24/03:43:25

Date: Mon, 24 Feb 1997 10:29:14 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Ove Kaaven <ovek AT arcticnet DOT no>
cc: djgpp AT delorie DOT com
Subject: Re: Starnge rm behavour
In-Reply-To: <5eof07$5ef$1@troll.powertech.no>
Message-ID: <Pine.SUN.3.91.970224102832.3675G-100000@is>
MIME-Version: 1.0

On Fri, 21 Feb 1997, Ove Kaaven wrote:

> "John M. Aldrich" <fighteer AT cs DOT com> wrote:
> 
> >The problem seems to be occurring because 'redir' doesn't perform
> >wildcard expansion on the command line it gets passed, yet it uses
> >spawnvp() to invoke the indicated program with the remaining arguments. 
> >Obviously, this breaks any program which gets passed a wildcard,
> >including 'rm'.
> 
> Isn't it easier to just let redir expand the wildcards?

No, that would require the user (you) to change the command line
depending on whether you use or don't use `redir'.  It is true that
many DJGPP programs won't care whether they get a wildcard (which
their startup code then expands) or an already expanded command line.
However, some programs *do* care: these are the programs which want to
see the original wildcard and expand it in their own ways.  InfoZip's
UnZip is one example of such a program; `find' from GNU Findutils is
another.  If `redir' would to expand wildcards, you will need to quote
them with an extra pair of quotes when you use `redir', or else they
will fail.

Another case when expansion by `redir' would be a Bad Thing is when
you run a non-DJGPP program under `redir': expanding the wildcard
might create a very long command line, which you cannot pass to
ordinary DOS programs.

- Raw text -


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