From: "Vyacheslav O. Myskin" Organization: BINP RAS, Novosibirsk, Russia To: djgpp AT delorie DOT com Date: Wed, 19 Feb 1997 14:30:58 +0600 Subject: Re: Starnge rm behavour Reply-To: V DOT O DOT Myskin AT inp DOT nsk DOT su Message-Id: <19B60DC0919@csd.inp.nsk.su> On 19 Feb 97 at 9:49, Eli Zaretskii wrote: > > On Tue, 18 Feb 1997, 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'. > > This analysis is correct. `redir' doesn't glob the command line so you > could use the same command with and without it (otherwise you would have > to quote the wildcards when running programs from `redir'). When in v2.01 > arguments passed by `spawnXX' stopped from being expanded on the child > side, this feature introduced a bug in some (admittedly rare) cases. > Sorry, but I don't understand... I thought that it was rm's job to expand a wildcard. How could spawnXX expand anything without knowing what does it mean for a particular child (rm in this case)? Or does rm refuse to expand '*' only because it knows that it was passed via spawnXX (can't see any sense)? So if rm sees an asterisk as an argument, why doesn't it process it in a proper way (that means search for all files in a directory and delete them)? What am I missing here? It wouldn't be so bad if the problem was with redir only - what's the use of launching rm via redir? But it makes impossible to use rm -f somedir/* in makefiles, which is much worse. ______________________________________________ Vyacheslav O. Myskin Budker Institute of Nuclear Physics (BINP RAS) Novosibirsk, Russia