home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3246 < prev    next >
Encoding:
Text File  |  1992-07-31  |  2.5 KB  |  58 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!tekbspa!tekbspa!esh
  3. From: esh@lithium.tekbspa.com (Edward S. Hirgelt)
  4. Subject: Re: Sort problem . .
  5. In-Reply-To: tchrist@convex.COM's message of 31 Jul 92 00:08:22 GMT
  6. Message-ID: <ESH.92Jul31101036@lithium.tekbspa.com>
  7. Sender: news@tss.com (USENET Network News)
  8. Organization: Direct Interfaces Corporation @ Teknekron
  9. References: <7=pmx9.messina@netcom.com> <1992Jul30.094428.17460@prl.dec.com> <33pmg
  10.     <1992Jul31.000822.13317@convex.com>
  11. Date: Fri, 31 Jul 1992 18:10:36 GMT
  12. Lines: 44
  13.  
  14.  
  15. On 31 Jul 92 00:08:22 GMT,
  16. tchrist@convex.COM (Tom Christiansen) said:
  17.  
  18. Tom> Boyd is dead right here.  I am constantly incensed by massively
  19. Tom> UNIX-ignorant programmers who inflict brain-damaged software on 
  20. Tom> the rest of us who actually try to use it.  You know, the ones who
  21. Tom> simply don't have any concept of how filters should work, what 
  22. Tom> stderr is for, how to parse options, what the exit status 
  23. Tom> should be used for, or who only supply an interactive interface.
  24.  
  25. Tom> Expected output should go out to stdout.  Exceptional output related
  26. Tom> to diagnostics or other error messages should go out stderr.  
  27.  
  28. This is definitely correct, but let me offer an explanation as to why
  29. this is a `good thing'. Actually, it's simple. I want to route
  30. `standard' output to a filter or to another file put keep errors routed
  31. to my terminal so I can see what is going on. Alternatives, I may log
  32. the errors from a command sequence for examination later.
  33.  
  34. There are a couple of concepts that help make Unix flexible and
  35. useful. One is the ability to compose functions (pipes). Associated with
  36. that is the split of information into stdout and stderr. This allows the
  37. construction of filters and the creation of log files easily.
  38.  
  39. Exit status is a pet peeve of mine. There are large numbers of programs
  40. in common use that do NOT set the error status at all. I suspect that
  41. the code just drops through main or uses a return without a value. I
  42. remember working with the Whitesmith's C compiler many years ago. It did
  43. set its exit status consistently. Unfortunately it was 180 degrees
  44. opposed to the standard in Unix. It used 1 for success and 0 for
  45. failure. It made for some very interesting makefiles. We took the
  46. expedient way out -- ignored the exit status from the compiler. We never
  47. really knew if the make succeeded or not.
  48.  
  49. It really isn't a matter of flexibility but rather one of consistency.
  50.  
  51. Thanks to Boyd and Tom to pointing this out.
  52.  
  53. Ed
  54. --
  55. Ed Hirgelt            esh@tss.com
  56. Direct Interfaces Corporation
  57. San Jose, Ca.
  58.