home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / shell / 5491 < prev    next >
Encoding:
Text File  |  1993-01-24  |  1.3 KB  |  48 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: >& redirects stderr AND stdout.
  5. Message-ID: <9302422.23216@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <aet.727670022@munagin>
  9. Date: Sun, 24 Jan 1993 11:56:03 GMT
  10. Lines: 36
  11.  
  12. aet@mullian.ee.mu.OZ.AU (bert thompson) writes:
  13.  
  14. >hi!
  15. >
  16. >i would like to know if there is a way to redirect ONLY stderr
  17. >rather than both stderr and stdout in csh (or in sh).
  18.  
  19. It's not possible in csh.
  20. In sh, do
  21.     command 2>errs
  22.  
  23. >one other question:
  24. >
  25. >how would i write a shell script which writes some text to the
  26. >stdin of a program and then hands stdin over to the user (tty).
  27.  
  28. Do something like this, in sh:
  29.  
  30.     {
  31.        echo "some text"
  32.        echo "some more text"
  33.        cat   # hand stdin over to the user
  34.     } | program
  35.  
  36. You can do something roughly similar in csh, but sh is a much better
  37. language for writing scripts in.
  38.  
  39. >many thanks and sorry if these are FAQs,
  40.  
  41. Apology accepted :-)
  42.  
  43. -- 
  44. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  45. This .signature virus is a self-referential statement that is true - but 
  46. you will only be able to consistently believe it if you copy it to your own
  47. .signature file!
  48.