Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!snorkelwacker.mit.edu!spool.mu.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.arch Subject: Re: Globbing Message-ID: <1991Mar2.035219.21905@Think.COM> Date: 2 Mar 91 03:52:19 GMT References: <43994@cos.com> <1991Feb28.225426.24072@jarvis.csri.toronto.edu> Sender: news@Think.COM Distribution: na Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 39 In article kenw@skyler.arc.ab.ca (Ken Wallewein) writes: >> From: cks@hawkwind.utcs.toronto.edu (Chris Siebenmann) >> This is because you still >> need to be able to do have programs (like rm and mv, or their >> equivalents) work on files with globbing characters in their names. You >> also have to stick this quoting logic into anything that spits out >> filenames that are going to be handed to other programs; consider "find >> / -exec operate {} \;" or its equivalent. > Good points. Note, though, that this really applies to _all_ "special" >characters, whether they are special to the shell or to the program. >Consider, for instance, files named "-" and "--". Or '"'. Pathological >examples abound :-). > > Perhaps what is needed is a way to tell a program unambiguously about its >arguments, eg: "this argument is a literal file specification, that >argument is a wildcard filespec, the next argument is an option, and after >that is non-filespec argument of arbitrary content". I have no suggestions >on how to do this. > > I think that argument about "its very infrequency increases the danger of >someone forgetting about the need for it" is probably not very well >founded. I agree. On Multics, we decided that there were a few commands that need to be able to take any file name that the kernel could handle. The "rename" and "delete" commands accept a "-name" option followed by a pathname, and they ignore a loading hyphen and don't glob that parameter. We felt that it was not important to make it easy to operate arbitrarily on files with screwy names, but it was important to make it easy to *fix* the names. In the case of find-like commands, this syntax makes it simple: find ... -exec rm -name {} \; -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar