Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!imagen!atari!portal!uunet!mcvax!ukc!warwick!mirk From: mirk@warwick.UUCP (Mike Taylor) Newsgroups: comp.unix.questions Subject: Re: simple question about mv Message-ID: <1063@ubu.warwick.UUCP> Date: 9 Feb 89 13:59:11 GMT References: <18231@adm.BRL.MIL> <4093@omepd.UUCP> <626@jonlab.UUCP> Sender: news@warwick.UUCP Reply-To: mirk@diamond.UUCP (Mike Taylor) Organization: Computer Science, Warwick University, UK Lines: 36 In article <626@jonlab.UUCP> jon@jonlab.UUCP (Jon H. LaBadie) writes: >Randal and others (this is not intended to pick on Randal's suggestion) >have proposed work-arounds to UNIX's command line interpreters (or to >mv's) deficiency in wild card matching. [He is referring to "wrong" behaviour of commands such as "mv *.flip *.flop"] Hmmm, you'd like to blame this one on UNIX's wild-card handling, would you? Well, think about it. In UNIX, the shell (whichever you choose to use) does *all* wildcard expansion, and passed the result to whatever commands are invoked. There is, therefore, a single, well- defined and well-understood patern of behaviour. The alternative, and this is what MSDOS does, is for each command to include its own pattern-matching code, so that, firstly, the wheel is re-invented over and over, and secondly, and IMHBDO much more seriously, different commands may expand wildcards in different ways. What you suggest is an example of this: The "*" in the mv(1) command is required to act differently from that in, for instance, the command "cp file1 file2 file3 dir", or "cp file* dir". This sort of incosistency, while it makes things more immediately intuitive for the novice, means that there is no real understanding of how such things will work in a general case - surely not a good state of affairs. Sorry if this sounds like flamage, you do make some good points in your article, (eg: that all the proposed solutions seem to involve invoking a new process other than the mv(1)s themselves) But it is important to have consistency, and I think that UNIX's approach to pattern matching is optimal. Let's all remember Henry Spencer's signature, shall we? "Those who do not understand UNIX are condemned to re-invent it, poorly." ______________________________________________________________________________ Mike Taylor - {Christ,M{athemat,us}ic}ian ... Email to: mirk@uk.ac.warwick.cs Unkle Mirk sez: "You fritter and waste the hours in an offhand waistcoat." :-) ------------------------------------------------------------------------------