From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fdb0e,cdca3dc8d6167cd4 X-Google-Attributes: gidfdb0e,public X-Google-Thread: 1164f8,cdca3dc8d6167cd4 X-Google-Attributes: gid1164f8,public X-Google-Thread: f7344,a808e23c428d1184 X-Google-Attributes: gidf7344,public X-Google-ArrivalTime: 2002-01-05 20:08:07 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!peer1-sjc1.usenetserver.com!usenetserver.com!easynews!sjc-peer.news.verio.net!news.verio.net!ord-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.os.vms,alt.sys.pdp10,comp.sys.dec Subject: Re: historical evidence of what went wrong at DEC References: <3roT7.207043$tf5.13617499@bin5.nnrp.aus1.giganews.com> <3C338089.1C12E6FA@trailing-edge.com> Sender: robert@bonomi.invalid From: robert@bonomi.invalid Originator: robert@bonomi.invalid Organization: Not Much X-Newsreader: trn 4.0-test69 (20 September 1998) Originator: root@c-ns. (Operator) Message-ID: Date: Sun, 06 Jan 2002 04:07:59 GMT NNTP-Posting-Host: 207.241.52.60 X-Complaints-To: abuse@verio.net X-Trace: ord-read.news.verio.net 1010290079 207.241.52.60 (Sun, 06 Jan 2002 04:07:59 GMT) NNTP-Posting-Date: Sun, 06 Jan 2002 04:07:59 GMT Xref: archiver1.google.com comp.os.vms:58576 alt.sys.pdp10:9152 comp.sys.dec:11056 In article , AG wrote: > >"Peter da Silva" wrote in message >news:a12sqc$107o$1@citadel.in.taronga.com... >> >> So how often have you needed to rename ALL your ".somethingelse" files >> to ".c"? Ever? When was the last time that you needed to rename a whole >> directory of files and the translation was as simple as one extension to >> another? > >Well, except for the ".c" bit, several times a day, the last time being this >last >Friday, see below ... > >> >> This specific example is very popular with VMS users, but in practice >> when have you ever needed to do this on UNIX? I don't think I've ever >> got a reasonable response to this question. >> > >Here is a try, let's see if it's reasonable: > >Suppose you are developing a program that must read and process a whole >lot of files from a Unix directory which are called *.something_or_other >where >the "*" is any valid file name. After processing a file, it must rename it >to something >like *.archive (this is a cast-iron spec requirement, non-negotiable). > >So far so good, but ... > >The program is still under development/debugging/tuning so you would like to >be >able to re-run it as often as needed with the same set of input files. But >remember? >Some (or all) of them have been renamed by the previous run... The most >natural >and obvious option would seem to be to just do some sort of: >"rename *.archive *.something_or_other" and off you go (you could even put >that >thing on a hot-key somewhere perhaps). >Of course, I know there are work-arounds (and I use some), but those >work-arounds >are simply trying to implement that semantics in a bit of a roundabout way. >For example, the need to write a (even small) script means that the >functionality *is* >needed but *is* lacking ... Beg to differ. If functionality is 'lacking', that means that you *can't* do the desired thing. That is a far cry from having the 'building blocks' to construct the composite function. In actuality, the fact that the requisite functionality _can_ be accomplished within the 'limitations' of the semantic structure existant -- that *proves* that the 'desired' semantics are =not= necessary. If one has a -recurring- need to mass-rename by arbitrary extension, then creating the following routine *once* provides the requisite functionality: #!/bin/csh foreach file ( *$1 ) mv $file `basename $file $1`$2 end it gets invoked as "rename .archive .something_or_other". if you don't like that, then a shell 'alias' for the following single-line command: 'find . -name '*$1' -prune -exec mv {} \`basename {} $1\`$2 \; One can debate the relative merits of having such a command as a 'default' feature of the environemt, vs. having to add an 'extension' to the factory- shipped environment. There is a difference in fundamental 'design philosophy" involved. In the UNIX world, by default, the 'command' never sees wildcards. All wildcard 'expansion' is done by the command-line-interpreter, in a single consistent manner. One instance of the code, One pattern of behavior. Universally _consistent_ behavior. smaller, simpler, code for the commands, as they _do_not_ have to be aware of *anything* regarding wildcards. The system, and command-interpreter, provide a set of 'building blocks', allowing the user to assemble *whatever*he*desires* for behavior/semantics of the 'advanced functions'. In the TOPS world, each command has knowledge of the original tokens on the command-line. And can do "whatever kind of magic" with them that it 'damn well pleases'. Consistency in behavior occurs *only*if* the various program authors co-operate to that end. Wildcard expansion logic, if any is employed, must be installed in _each_ application. makes the application larger, more complex. Hopefully, it uses a 'library' routine to provide 'standard' expansion -- but that fails if 'non-standard' expansion rules are desired. TOPS provides a 'richer' set of 'built-in' advanced functions. but if you desire _different_ behavior, the implementation effort is far greater. Further, the semantics of TOPS wildcard expansion is ambiguous. to wit: "copy *.foo *.bar" implies 'create a list of all names ending in ".foo", create a second list from the first, changing the suffix to "bar". perform the indicated action on the corresponding names in each list'. *BUT* "wc *.foo *.bar" would seem to imply something completely different, no? Whereupon, one is either into 'context-sensitive' wild-card expansion (where "*.foo *.bar" means one thing to 'wc', and something else to 'copy'), or silliness like "(.foo|.bar)" for 'anything that matches either suffix'. and the additional hyper-silliness that accrues if one suffix (or both) actually contains some of those magic 'meta-characters'. TThe TOPS user-interface does have a bunch of really *great* _convenience_ features -- command-completion, and the [ESC] prompting leading you through required arguments/parameters, come immediately to mind. The supposedly superior semantics of TOPS implementaton of "copy *.foo *.bar", is not a strong argument. what does "copy b*.foo c*.bar" do? Or how about "copy b*xx charlie*foo.baz"? Or "copy *.* boo*-*.old" ?? suppose you want to rename *every* file, by appending '-old' to the suffix. how's *that* done? "copy *.* *.old" would replace the prior suffix, right? how about "copy *.* *.*-old"? I've been away from TOPS too long, i'm not even sure which, _if_any_, of the above (semi-)flippant examples are valid in that environment. If not, they illustrate deficiencies of the TOPS semantics. Corollary, for the ones that are -not- valid, how hard is it to *implement* an equivalent, or work-around? Doesn't have to be a 'generalized' solution -- specific to the format of the individual example is sufficient.