home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / amiga / programm / 12499 < prev    next >
Encoding:
Text File  |  1992-08-20  |  2.0 KB  |  51 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!chx400!bernina!wild
  3. From: wild@nessie.cs.id.ethz.ch (Markus Wild)
  4. Subject: Re: Console file handlers from within a Shell started program
  5. Message-ID: <1992Aug20.152717.11514@bernina.ethz.ch>
  6. Sender: news@bernina.ethz.ch (USENET News System)
  7. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  8. References: <14545@borg.cs.unc.edu> <1b854d0d.ARN237c@prolix.pub.uu.oz.au> <14605@borg.cs.unc.edu>
  9. Date: Thu, 20 Aug 1992 15:27:17 GMT
  10. Lines: 39
  11.  
  12. In article <14605@borg.cs.unc.edu> tell@rukbat.cs.unc.edu (Stephen Tell) writes:
  13. >In article <1b854d0d.ARN237c@prolix.pub.uu.oz.au> munnari!labtam!eyrie!prolix!dac writes:
  14. >>In article <14545@borg.cs.unc.edu>, I wrote:
  15. >
  16. >>> Last time I checked (1.3) AmigaDOS didn't have standard error.  The C runtime
  17. >>> environments for Manx, Lattice/Sas, et. al. opened the console to simulate
  18. >>> it.
  19. >
  20. >>It works for me
  21. >>   fprintf(stderr,WELCOME"\n%s",ctime(×tart));
  22. >>writes to stderr, and 
  23. >>   printf("Particulars is %s\n",particulars);
  24. >>writes to stdout.
  25. >
  26. >>If I redirect stdout via '>', then I get the stderr output on the
  27. >>console, and not in the redirected output.
  28. >
  29. >>Where is the problem?
  30. >> David Andrew Clayton.        dac@prolix.pub.uu.oz.au 
  31. >
  32. >Now, show me how to put stderr in a file and let stdout go to the console...
  33. >and how to put stderr in one file and stdout in another.  Can't be done, to
  34. >my knowledge.
  35.  
  36. It's possible with my pdksh port, just do
  37.   your_program > stdout_file 2> stderr_file
  38.  
  39. or for both into one file
  40.   your_program > both_file 2>&1
  41.  
  42. Should work for both ixemul and plain programs. For the latter, it will only
  43. work if those processes use the REAL stderr new with OS2.0, not when they
  44. dup the console with "*".
  45.  
  46. -Markus
  47. -- 
  48. Markus M. Wild    -  wild@nessie.cs.id.ethz.ch  |  wild@amiga.physik.unizh.ch 
  49. Vital papers will demonstrate their vitality by spontaneously moving
  50. from where you left them to where you can't find them.
  51.