[indiana-discuss] [osol-discuss] why gnu chmod in os2008.11?

Dennis Clarke dclarke at blastwave.org
Fri Jan 16 19:38:37 PST 2009


> Mike Meyer wrote:
>> On Fri, 16 Jan 2009 17:42:00 -0500 (EST) Dennis Clarke
>> <dclarke at blastwave.org> wrote:
>>> If the Solaris commands become a superset of the Gnu ones, then that
>>> position becomes a fait accompli.
>>
>> Thus avoiding the entire question of whether or not that's the best -
>> or even a desirable - goal.
>
> There are lots of proposals for someone else to do work, but few
> volunteers stepping up to the plate.

well hold on a sec there.

I was just looking at using a search for "gnu" in arg[0] in order to
determine if the current program was supposed to demonstrate GNUism or
UNIXism. The first thought that hits me is that a "grand unified" ls would
be needed ( and all other things that overlap in XPG4 land ) where each
executable must determine its own nature by both PATH and by options
provided. The entire idea is weak because one may move the executable
/usr/gnu/bin/foo to /tmp/foo and then a default behavior must be assumed.

I am just thinking out loud here.

If I go with some simplistic hack that checks if ( strstr( argv[0], "ucb"
) != NULL ) sort of thing then I can get away with this :

bash-3.2$ pwd
/export/home/dclarke/pgm/C/gnu
bash-3.2$ cc $CFLAGS -o ls hack.c
bash-3.2$ ./ls -l -v --debug
DEBUG: UNIXism assumed
ls: illegal option -- v
usage: ls -1RaAdCxmnlogrtucpFbqisfL [files]
bash-3.2$ cd ..
bash-3.2$ ./gnu/ls -l -v --debug
DEBUG: gnuism required
total 10
-rw-r--r-- 1 dclarke csw  683 Jan 16 22:28 hack.c
-rwxr-xr-x 1 dclarke csw 8512 Jan 16 22:29 ls
bash-3.2$ mkdir ucb
bash-3.2$ cp -p gnu/ls ucb
bash-3.2$ ./ucb/ls -l -v --debug
DEBUG : ucb behavior required
total 9
-rw-r--r--   1 dclarke       683 Jan 16 22:28 hack.c
-rwxr-xr-x   1 dclarke      7888 Jan 16 22:29 ls

Yes, this is messy.

It is not at all the sort of thing that happens in a single one nighter
and I don't even know if it is possible. Or reasonable. Regardless of the
need for someone to step up to the plate this requires some careful
thought first.

Dennis




More information about the indiana-discuss mailing list