Xref: utzoo comp.arch:20253 comp.os.misc:1472 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.arch,comp.os.misc Subject: Re: UNIX mind-set -> OK, OK! Message-ID: <1991Jan16.182106.1758@Think.COM> Date: 16 Jan 91 18:21:06 GMT References: <1991Jan14.013815.11419@ims.alaska.edu> <11314@lanl.gov> <1991Jan16.063253.2834681@locus.com> Sender: news@Think.COM Followup-To: comp.os.misc Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 36 In article <1991Jan16.063253.2834681@locus.com> dana@locus.com (Dana H. Myers) writes: > Ok. Once you said "All tools should work together in a well >thought out way". Then you say that applications should be forced to >somehow tell the shell whether to glob or not. What this means is that >some applications would glob while others wouldn't. How would one know >what a given app does for sure? Hmmm.. I'm getting tired of repeatedly seeing this argument. How do you know that *any* program follows common conventions? For instance, how would one know that a given app reads stdin and writes stdout, so that it can be used as a filter? You know because someone once proclaimed this convention, and everyone simply follows it (except when they don't, such as in the "passwd" command, or curses applications, etc.). > Also, how would you modify the way the shell works in order to >allow applications to control whether globbing is done on args? Please >keep in mind the way the shell works; it fork()s (that is, Jim, makes >another process which is a running copy of the shell) and then exec()s >the application (that is, replaces the running copy of the shell with >the application). At this point, the arguments have been processed >and the shell no longer has any control. There are lots of ways to do this. The simplest way is for the shell not to glob, but for the application to call a library routine that does it. If you want the shell to glob before it invokes the application, it could maintain a database specifying the syntax of each command. Or it could open the executable and read the argument syntax specification from the header before globbing. None of these changes are feasible in current Unix, but they are ideas for future OSes. -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar