home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5498 < prev    next >
Encoding:
Internet Message Format  |  1993-01-27  |  2.0 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!destroyer!gumby!yale!yale.edu!ira.uka.de!Germany.EU.net!pki-nbg!pki-nbg.philips.de!ln_smr
  2. From: ln_smr@pki-nbg.philips.de (Stephen Riehm)
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: >& redirects stderr AND stdout.
  5. Message-ID: <ln_smr.728058390@pki-nbg.philips.de>
  6. Date: 26 Jan 93 14:26:30 GMT
  7. References: <aet.727670022@munagin> <9302422.23216@mulga.cs.mu.OZ.AU>
  8. Sender: news@pki-nbg.philips.de
  9. Reply-To: ln_smr@pki-nbg.philips.de
  10. Lines: 45
  11.  
  12. fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON) writes:
  13.  
  14. >aet@mullian.ee.mu.OZ.AU (bert thompson) writes:
  15.  
  16. >>hi!
  17. >>
  18. >>i would like to know if there is a way to redirect ONLY stderr
  19. >>rather than both stderr and stdout in csh (or in sh).
  20.  
  21. >It's not possible in csh.
  22.  
  23. yeah 'tis! try:
  24.  
  25.     ( some_program > /dev/null ) >& error.file
  26.  
  27. OK its a bit of a kluge, but you could also do the following to get
  28. stdout on your stdout:
  29.  
  30.     ( some_program > /tmp/file ) >& error.file ; {cat,more,less} /tmp/file
  31.  
  32. >[irrelevent stuff narked], but sh is a much better
  33. >language for writing scripts in.
  34.  
  35. This is definitely true. csh (or better, tcsh) has a great UI, but for
  36. real scripts, /bin/sh is:
  37.     a> supported on all unix platforms
  38.     b> almost standardised accross platforms
  39.     c> much more flexible
  40.     d> quicker (startup time at least)
  41. csh on the other hand is;
  42.     a> not supported on all platforms
  43.     b> not standardised (there are many different flavours)
  44.     c> limited in programming structure (no procedures for a start)
  45.  
  46. catchya
  47.  
  48. --------------------------------------------------------------------
  49. Stephen Riehm           Configuration Management          _-_|\ 
  50. ln_smr@pki-nbg.philips.de  Philips Kommunikations Industrie  /     \
  51. Work: +49 911 526 2975       Nu"rnberg, Germany             \_.-.!/
  52. Fax:  +49 911 526 3678       "I was there, now I am here!"          v 
  53. "My company speaks another language, I CAN'T speak on its behalf"
  54. PS: You may think I am joking, I can't speak the language that well so
  55.         PLEASE DON'T REPLY IN GERMAN!
  56.              - thanks -
  57.