Mail Archives: djgpp/1997/02/24/03:43:25
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 -