Date: Mon, 24 Feb 1997 10:29:14 +0200 (IST) From: Eli Zaretskii To: Ove Kaaven cc: djgpp AT delorie DOT com Subject: Re: Starnge rm behavour In-Reply-To: <5eof07$5ef$1@troll.powertech.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Fri, 21 Feb 1997, Ove Kaaven wrote: > "John M. Aldrich" 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.