Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!rice!uw-beaver!ubc-cs!alberta!arcsun.arc.ab.ca!arcsun!kenw From: kenw@skyler.arc.ab.ca (Ken Wallewein) Newsgroups: comp.os.misc Subject: Re: Globbing Message-ID: Date: 8 Mar 91 21:56:22 GMT References: <1991Feb18.152347.28521@dgbt.doc.ca> <474@bria> <19217@cbmvax.commodore.com> <5573:Feb2307:19:4491@kramden.acf.nyu.edu> <19336@cbmvax.commodore.com> <43994@cos.com> Sender: nobody@arc.ab.ca (Absolutely Nobody) Distribution: na Organization: Alberta Research Council, Calgary Alberta, Canada Lines: 58 In-Reply-To: peter@ficc.ferranti.com's message of 7 Mar 91 16:48:48 GMT In article peter@ficc.ferranti.com (Peter da Silva) writes: In article kenw@skyler.arc.ab.ca (Ken Wallewein) writes: > Peter, you asked me to come up with other examples besides the mv/rename > one. [...] It wasn't easy; they don't exist now, as far as I know -- maybe > due to a chicken-and-egg precedence problem Look for examples on VMS, DOS, AmigaDOS, etc. No catch-22 there. I'm familiar with VMS and AmigaDOS; I run one and own the other. But I can't think of any commands on either that use multiple separately globbed arguments. Not: I'm not saying wildcard; I'm saying globbed. In the case of RENAME, for example, the second wildcard argument is an _output_ filespec, and as such is not globbed. Which did you have in mind? > -- but here are a couple: > difff [args] spec1 [args] spec2 [moreargs (why not?)] Amazing. A second case. I'm not sure I'd want to do this, just out of concern for the possibility of unmatched files in spec1 or extra files in spec2. It'd be possible to get the equivalent functionality even without a more complex command line, but you said you don't want to consider that. Fair enough. Hey, I design 'em. You build 'em. :-) I though of that. Such a program, to be useful, would need to be able to handle unmatched files, as I implied in the description of the arguments. > Another example might be one wherein one set of files is used to process > another set of files -- a glorified 'make' or 'xch', perhaps. Now you're really pushing it. I think this, if anything, illustrates that this particular case (two corresponding lists of file names) is a pretty damn rare one, and shell globbing *can* deal with it... with a slightly different syntax. Not within your rules for this contest, but a reasonable solution. "Slightly" different? _Existing_ shell globbing? Certainly, a sufficiently sophisticated globbing syntax enxironment could do it. If your solution is within the spirit of this discussion, I'm curious. > What if globbing were turned off by default, and one escaped or quoted > an argument to make it glob? I have the impression that that has been > tried and abandoned. Does anyone know why? The default action you want is to glob. For a current shell that does this, try "tcl". I thought tcl was sort of a compiled-in command language processor -- but I confess far more curiosity than knowledge. Please tell me more. -- /kenw Ken Wallewein A L B E R T A kenw@noah.arc.ab.ca <-- replies (if mailed) here, please R E S E A R C H (403)297-2660 C O U N C I L