On Sun, Jul 8, 2018 at 8:57 PM Larry McVoy <lm@mcvoy.com> wrote:
On Sun, Jul 08, 2018 at 08:05:29PM -0400, Dan Cross wrote:
> This. Much of the issue with Unix was convention, or rather, lack of a
> consistent convention. Proponents of DEC operating systems that I've known
> decry that Unix can't do stuff like, `RENAME *.FTN *.FOR`, because the

http://mcvoy.com/lm/move

fixes that.  Since around the late 80's.

Oh sure, you can do it. Quoting the glob patterns to avoid shell expansion is trivial, and then writing a command to expand the patterns oneself (as you've clearly done) isn't too bad.

But that's not the point. The point is that there was no standard way to do it: is there a command to translate character sets, such as `transcs *.latin1 *.utf8` ?

Incidentally, I think that `move` sort of supports the thesis: I see you pulled in Ozan's regex and Guido's globbing code and _distributed them with move_. This latter part is important: I imagine you did that because the functionality wasn't part of the base operating system image.

(Pretty cool commands, by the way; I'm going to pull that one down locally.)

> main(argc, argv)
>         int argc;
>         char *argv[];
> {
>         if (--argc > 0 && *argv[1] == '-') {
>                 argv++;
>                 while (*++*argv)
>                 switch (**argv) {
>                 case 'a':
>                         /* etc.... */
>                         continue;
>                 }
>         }
>         /* And so on.... */
>
> I mean, goodness: we didn't even use getopt(3)! It was all hand-rolled! And
> thus inconsistent.

Gotta agree with this one.  Getopt should have been a thing from day one.
We rolled our own that I like:

http://repos.bkbits.net/bk/dev/src/libc/utils/getopt.c?PAGE=anno&REV=56cf7e34186wKr7L6Lpntw_hwahS0A

That's pretty cool.

But again, I don't think it's that these things weren't *possible* under Unix (obviously they were and are) but that they weren't _conventional_. I don't think a VAX running VMS would have immolated itself if you didn't use the VMS routines to do wildcard processing, but it would probably have been considered strange. Under Unix that was the norm.

        - Dan C.