home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / wizards / 4814 < prev    next >
Encoding:
Text File  |  1992-11-20  |  3.7 KB  |  80 lines

  1. Newsgroups: comp.unix.wizards
  2. Path: sparky!uunet!munnari.oz.au!yoyo.aarnet.edu.au!news.adelaide.edu.au!augean.eleceng.adelaide.edu.AU!hfrd.dsto.oz.au!dall
  3. From: dall@hfrd.dsto.gov.au (Ian Dall)
  4. Subject: Re: The Problem with UNIX
  5. Message-ID: <1992Nov20.025743.1083@hfrd.dsto.gov.au>
  6. Sender: dall@hfrd.dsto.gov.au (Ian Dall)
  7. Organization: Defence Science and Technology Organisation
  8. References: <1992Nov9.172715.16367@cs.wisc.edu>  <17934@autodesk.COM>
  9. Date: Fri, 20 Nov 1992 02:57:43 GMT
  10. Lines: 68
  11.  
  12.  
  13. In article <17934@autodesk.COM>, dansmith@Autodesk.COM (Daniel Smith) writes:
  14. > In <1992Nov13.213107.5722@chpc.utexas.edu> michael@chpc.utexas.edu (Michael Lemke) writes:
  15. > > In article <1992Nov13.094336.2341@aber.ac.uk> btk@aber.ac.uk (Ben Ketteridge) writes:
  16. > > >For example, just to take the 'cat a b > b' problem, you are suggesting IMHO 
  17. > No it isn't, consider my "glasses of water" theorem:
  18. >          |         |          |           |
  19. >          |~~~~~~~~~|          |~~~~~~~~~~~|
  20. >          |         |          |           |
  21. >          |         |          |           |
  22. >          |    A    |          |    B      |
  23. >          |         |          |           |
  24. >           \_______/            \_________/
  25. > Ok, B can get bigger (i.e. a goblet, or a pitcher) to accept water
  26. > from A, but what do you mean to do with B's original water?
  27.  
  28. The solution of the problem to to mv cat pour :-)
  29.  
  30. It is true that (if you don't know unix) you might think cat a b > b
  31. means concatenate a with b and stick the result in b. This actual
  32. behaviour is somewhat counter intuitive although this sort of problem
  33. is not unique to unix. I'd be generally suspicious of using three
  34. operand 'commands' (statements, functions, procedures whatever)
  35. with the output operand the same as one of the input operands unless
  36. I *know* it works. Eq we expect a = a * b to work. But suppose a and
  37. be are matrices, we wouldn't expect mat_mul(a, b, a) to work unless
  38. we were told it was safe.
  39.  
  40. The question is not just whether "cat a b > b" should do something
  41. sensible, but whether it should warn the user. The latter is possible,
  42. by means of stat and many (most?) cats produce a warning even though
  43. it is the shell which has done the redirection.
  44.  
  45. Things like "cat a b | cat > a" are a lot more tricky to detect and
  46. frankly I don't see that you can do much except give users who can't
  47. understand pipes and redirections an interface which doesn't use
  48. those concepts. Power is risky.
  49.  
  50. The question of whether to glob in the shell or in the process is a
  51. little different. Here we are talking about a design decision on where
  52. to draw the lines when splitting up the desired functionality.
  53. Ideally, modules shouldn't have to know much about other modules. So
  54. *if* a major design goal is VMS like renaming, then globbing in the
  55. shell is a bad decision. On the other hand, it is not impossible --
  56. you could for example have a table of "installed" processes and their
  57. arguments which the shell could refer to. The simplest thing would
  58. be to just not do the globbing for those processes leaving it to the
  59. process but you could have some sort of syntax to describe what should
  60. be done with the arguments.
  61.  
  62. I'm not suggesting I want such an interface (I like knowing exactly
  63. what the *s etc are going to do), just pointing out that a) it is
  64. possible but that b) requiring the shell to know about processes is
  65. not clean because it breaks the original "modularization". So, coming
  66. to the original project, I can't see it being of much interest to
  67. people who *want* unix features. For less sophisticated users, maybe
  68. a shell in general (and the csh in particular) are not the solution.
  69.  
  70. -- 
  71. Ian Dall          I'm not into isms, but hedonism is the most
  72.                   harmless I can think of. -- Phillip Adams
  73.  
  74. internet: dall@hfrd.dsto.gov.au
  75.