Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!hubcap!ncrcae!ncr-sd!hp-sdd!hplabs!sdcrdcf!ism780c!mikep From: mikep@ism780c.UUCP (Michael A. Petonic) Newsgroups: comp.unix.wizards Subject: Re: globbing in the shell (Was Re: more rm insanity) Message-ID: <8146@ism780c.UUCP> Date: Sun, 6-Dec-87 02:43:29 EST Article-I.D.: ism780c.8146 Posted: Sun Dec 6 02:43:29 1987 Date-Received: Fri, 11-Dec-87 06:15:36 EST References: <1257@boulder.Colorado.EDU> <6840002@hpcllmv.HP.COM> <9555@mimsy.UUCP> <890@russell.STANFORD.EDU> <9610@mimsy.UUCP> Reply-To: mikep@ism780c.UUCP (Michael A. Petonic) Organization: Interactive Systems Corp., Santa Monica CA Lines: 44 In article <9610@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >One suggestion I have heard, which makes some sense to me, would >be to have the shell provide an environment variable giving the >exact command line used to invoke any particular command: > > Yes master? rm a.out core *.o *.s * .i > ----- > oops, a tab! > >would run `rm' with > > "CMDLINE=rm a.out core *.o *.s *\t.i" > >in its environment. Programs that deem themselves potential >troublemakers (rm) could then look at the original command line. >Programs that wanted special globbing (grep) could do their own >command line parsing, assuming that `glob' was provided as a separate >program or a library routine. Programs that do not care (all the >rest) would ignore $CMDLINE. Ahhh, looks good, initially. But suppose the guy typed: rm /tmp/* .i ---- a real wanted tab and really did want to remove everything out of /tmp and also ".i" in the current directory? What would RM do? Do a y/n query? I guess this wouldn't be too much of a hassle if in interactive mode, but what happens if rm is being run in a shellscript and that's exactly what he wanted. Would RM have to have a special case if it was running in a shell script or in the background? The way I feel about it, introducing "intelligence" in standard utilities beyond what was originally there tends to cloud up UNIX. If one keeps up this "creeping featurism", then one runs the risk of having sooo many exceptions to general rules that UNIX becomes unwieldy. -MikeP -------- Michael A. Petonic (213) 453-8649 x3247 INTERATIVE Systems Corporation "My opinions in no way influences 2401 Colorado Blvd. the price of tea in China." Santa Monica, CA. 90404 {sdcrdcf|attunix|microsoft|sfmin}!ism780c!mikep