Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!cos!fetter From: fetter@cos.com (Bob Fetter) Newsgroups: comp.os.misc Subject: Re: Globbing Message-ID: <44431@cos.com> Date: 30 Mar 91 01:33:40 GMT References: <44381@cos.com> Reply-To: fetter@cos.UUCP (Bob Fetter) Organization: Corporation for Open Systems, McLean, VA Lines: 106 In article peter@ficc.ferranti.com (Peter da Silva) writes: >In article <44381@cos.com> fetter@cos.UUCP (Bob Fetter) writes: >> Um, with the small size and all, does that include support for >> multiple commands and piping? If so, it sounds like tight code! > >Nope. No backgrounding either. > >I like the quote nesting business, and the [glob *.c] stuff. I could >make glob a builtin for efficiency, too. >-- >Peter da Silva. `-_-' peter@ferranti.com >+1 713 274 5180. 'U` "Have you hugged your wolf today?" Well, one thing I've always liked from other systems is inline iteration. This is a simple, yet powerful construct: one that seems both simpler yet more powerful than equivalent looping/cycling constructs I've seen in Unix shells. (I'm sure there's powerful stuff out there... it's just that I've not yet seen it all.) Iteration uses a list, this list contained within parenthesis. For each member of the list, the construct within which the list is embedded is iterated upon and invoked. To take as an example, using the [..] syntax: touch ([glob *]).backup will, once [glob *] is evaluated, say into: file1.c file1.o makefile readme result in the execution of touch file1.c.backup touch file1.o.backup touch makefile.backup touch readme.backup Or, as another example, lets say wanting to put a single file in multiple archives, all named with a '.archive' suffix: ar a ([glob *.archive]) the_file Of course, variable expansion should be supported: set MYLIST="fred joe bill wally" mail ($MYLIST) -f mailfile