Xref: utzoo comp.os.misc:322 comp.unix.wizards:5563 Path: utzoo!mnetor!uunet!husc6!psuvax1!gondor.cs.psu.edu!schwartz From: schwartz@gondor.cs.psu.edu (Scott E. Schwartz) Newsgroups: comp.os.misc,comp.unix.wizards Subject: Re: Command interfaces Message-ID: <3167@psuvax1.psu.edu> Date: 9 Dec 87 08:21:14 GMT References: <1257@boulder.Colorado.EDU> <6840002@hpcllmv.HP.COM> <9555@mimsy.UUCP> <798@rocky.STANFORD.EDU> <432@cresswell.quintus.UUCP> <3161@psuvax1.psu.edu> <5565@oberon.USC.EDU> Sender: netnews@psuvax1.psu.edu Reply-To: schwartz@gondor.cs.psu.edu (Scott E. Schwartz) Organization: Penn State University, University Park, PA Lines: 40 In article <5565@oberon.USC.EDU> blarson@skat.usc.edu (Bob Larson) writes: >In article <3161@psuvax1.psu.edu> schwartz@gondor.psu.edu (Scott E. Schwartz) writes: >When talking about primos wildcards, you should remember that they are >in general more powerfull that unix wildcards. Besides + (match any >single character) @ (match a sequence of 0 or more characters not >containing .) and @@ (match any sequence), there are facilities to do >name genearation and iteration. Agreed, to some extent. But the dark underside of the primos command processor is that you can't ever have more functionality than it gives you at the moment. Unix pipes and such mean that the shell's metacharacters can be aimed at handling the simple general case, and letting shell control structures do the rest. >For example, how would you do the equivelent of this in unix: > >cmpf *>old>@@.(c,h) == -report ==.+cmpf -file > >(Explanation: compare all files in the old sub-directory ending in .c or >.h with the file of the same name in the current directory, and put >the output in the file of the same name with .cmpf appended. Non-files >(directories and segment directories) ending in .c or .h are ignored. >[I do prefer the output of diff -c to that of cmpf, but that isn't >what I'm talking about here.] Well, for the bourne shell this will do: (cd ./old; ls | while read f; do if [ -f $f ] ; then echo $f; fi; done) | while read f; do diff ./old/$f $f >$f.+cmpf; done byzantine, I agree, but easy to whip up. If i've missed a condition that the primos command applies, I be it can be corrected with little difficulty. By the way, how does primos handle something like ls [!B]*.[!c] i.e. multiple internal negation. -- Scott Schwartz schwartz@gondor.cs.psu.edu