Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!sri-spam!ames!oliveb!intelca!mipos3!omepd!littlei!reed!tektronix!orca!paulsc
From: paulsc@orca.UUCP
Newsgroups: comp.unix.wizards
Subject: Re: globbing in the shell (Was Re: more rm insanity)
Message-ID: <2434@orca.TEK.COM>
Date: Thu, 3-Dec-87 20:19:09 EST
Article-I.D.: orca.2434
Posted: Thu Dec  3 20:19:09 1987
Date-Received: Thu, 10-Dec-87 04:49:41 EST
References: <1257@boulder.Colorado.EDU> <6840002@hpcllmv.HP.COM>
Reply-To: paulsc@orca.UUCP (Paul Scherf)
Organization: Tektronix, Inc., Wilsonville, OR
Lines: 38
Summary: this might fix the problem

I remember a couple people on "system staff"
at one site talked about adding a "command line" argument to main().
Something like:

	int main(int argc, char *argv[], char *command_line);

They sounded serious and had the authority to do it.
I never found out, if they actually tried it or not.

The "new" exec*() system call(s) could take an extra argument
(a pointer to the command line string).
The "old" exec*() system call(s) could supply an empty string
or NULL pointer or some other reasonable facsimile for a command line.
The programs that make the most difference
could be fixed first (the shells, rm, ...).
Programs that didn't care about the command line could be left alone.
Other programs could wait, until you got to them.
In particular, rm could check command_line
for magic characters and behave in a more friendly manner.

Your special "fixed" programs wouldn't be directly portable
to machines without your special kernel,
but I think the differences would be managable as "#ifdef"'s.
(This would have been on PDP11's and VAX780's,
so there would not be problems with programs that didn't know about
the extra argument to main().)

I won't say it would be easy, but it certainly sounds doable.
The above steps could be done one at a time,
without leaving you with an unusable system in-between.
On many machines, programs that don't know about the extra argument
wouldn't be affected.
I think it sounds like an interesting experiment.
If someone hasn't already done it,
it would probably also make a nice USENIX paper.

Paul Scherf, Tektronix, Box 1000, MS 61-033, Wilsonville, OR, USA
paulsc@orca.GWD.Tek.COM			tektronix!orca!paulsc