Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!mimsy!aplcen!osiris!mjr From: mjr@osiris.UUCP (Marcus J. Ranum) Newsgroups: comp.unix.wizards Subject: Re: globbing in the shell - let the shell handle it Message-ID: <1475@osiris.UUCP> Date: Sun, 6-Dec-87 11:49:28 EST Article-I.D.: osiris.1475 Posted: Sun Dec 6 11:49:28 1987 Date-Received: Fri, 11-Dec-87 07:08:10 EST References: <1257@boulder.Colorado.EDU> <6840002@hpcllmv.HP.COM> Organization: My Etch-A-Sketch runs X-Windows Lines: 31 Summary: hey, hacker, leave my kernel alone... > Rather than > > int main(int argc, char *argv[], char *command_line); Since the program is already passed a pointer to the environment at invocation, why not just have whatever shell you're running constantly keep an environment variable pointing to CMDLINE or something like that ? That way, since you're already talking about re-writing loads of stuff, you can re-write a shell to maintain the command line, and then re-write rm(1) or whatever the way you want it. Better yet, your version of rm(1) can check to see if CMDLINE is set in the invocation environment, and assume that if it is your user DOES want all the extra safety, otherwise rm can just unlink the damn file so the rest of us can get on with our work. so: if(( cp = getenv("CMDLINE")) != NULL) { /* make it look like the MSDOS delete command */ /* are you SURE (Y/N) ? etc. */ } else { /* make it look like rm(1) */ } The big advantage to this suggestion is that people who want to have all this kind of crap in their PATH can, and (hopefully) those users who manage to "put up" with UNIX as-is can ignore it. --mjr(); -- Once, there was NO fun... This was before MENU planning, FASHION statements or NAUTILUS equipment... Then, in 1985.. FUN was completely encoded in this tiny MICROCHIP... It contains 14,768 vaguely amusing SIT-COM pilots!!