home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / wizards / 4820 < prev    next >
Encoding:
Internet Message Format  |  1992-11-20  |  1.9 KB

  1. Xref: sparky comp.unix.wizards:4820 comp.unix.shell:4824 comp.unix.misc:4277
  2. Newsgroups: comp.unix.wizards,comp.unix.shell,comp.unix.misc
  3. Path: sparky!uunet!munnari.oz.au!uniwa!DIALix!metapro!bernie
  4. From: bernie@metapro.DIALix.oz.au (Bernd Felsche)
  5. Subject: Re: The Problem with UNIX
  6. Message-ID: <1992Nov20.025401.29861@metapro.DIALix.oz.au>
  7. Organization: MetaPro Systems, Perth, Western Australia
  8. References: <1992Nov9.172715.16367@cs.wisc.edu> <aldavi01.721333614@starbase.spd.louisville.edu> <1992Nov13.094336.2341@aber.ac.uk> <id.SY1V.ITA@ferranti.com>
  9. Date: Fri, 20 Nov 92 02:54:01 GMT
  10. Lines: 32
  11.  
  12. In <id.SY1V.ITA@ferranti.com> peter@ferranti.com (peter da silva) writes:
  13.  
  14. >In article <1992Nov13.094336.2341@aber.ac.uk>
  15. >   btk@aber.ac.uk (Ben Ketteridge) writes:
  16. >> For example, just to take the 'cat a b > b' problem, you are suggesting IMHO
  17. >> that the shell shouldn't check redirection of output against the input
  18. >> and warn the user in this case.
  19.  
  20. >How does the shell know that the "b" argument to cat is the same as the "b"
  21. >output file? Because the file exists?
  22.  
  23. >touch b a 
  24. >cat a b > b 
  25. >b: File exists.
  26.  
  27. >What's your problem?
  28.  
  29. [ maybe I misunderstand your followup, but ]
  30. But isn't it too late when cat starts. "b" has already been truncated.
  31.  
  32. The "problem" is not in the arguments to a command; that'd
  33. be ludicrous to parse and interpret, but rather in the
  34. redirection to existing files. Some shells do incorporate
  35. "noclobber" options so that a deliberate overwrite has to be
  36. indicated using "!" after the redirection symbol. It's
  37. interesting to note that those shells actually _need_
  38. command history editing because of human factors!
  39. -- 
  40. +-----+ Bernd Felsche                     _--_|\  #include <std/disclaimer.h>
  41. | | | | MetaPro Systems Pty Ltd          /      \ bernie@metapro.DIALix.oz.au
  42. | | | | 328 Albany Highway,              X_.--._/         Fax: +61 9 472 3337
  43. |m|p|s| Victoria Park, Western Australia 6100  v        Phone: +61 9 362 9355
  44.