home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14714 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.5 KB

  1. Xref: sparky comp.unix.questions:14714 comp.unix.shell:5081
  2. Path: sparky!uunet!think.com!barmar
  3. From: barmar@think.com (Barry Margolin)
  4. Newsgroups: comp.unix.questions,comp.unix.shell
  5. Subject: Re: Redirection of the Echo command to other tty's
  6. Date: 15 Dec 1992 22:29:23 GMT
  7. Organization: Thinking Machines Corporation, Cambridge MA, USA
  8. Lines: 22
  9. Message-ID: <1glm83INNqas@early-bird.think.com>
  10. References: <1992Dec14.222553.22768@sactoh0.sac.ca.us>
  11. NNTP-Posting-Host: telecaster.think.com
  12. Keywords: unix echo shell
  13.  
  14. In article <1992Dec14.222553.22768@sactoh0.sac.ca.us> ccpoabt!dan@sactoh0.SAC.CA.US (Daniel James) writes:
  15. >I get the following output on the console:
  16. >----------------------------------------------------
  17. >Line One
  18. >        Line Two
  19. >
  20. >I.E., during redirection, the \n changes from cr/lf to just lf
  21.  
  22. The translation of LF to CR/LF is controlled by the "onlcr" and "opost" tty
  23. mode, which apparently wasn't enabled on the console when you ran your
  24. script.  Add "stty onlcr opost" to your script.
  25.  
  26. I'm not sure why this problem only affects your script and not the programs
  27. that the user on the console is running, unless you were doing this while a
  28. full-screen program (such as Emacs) was running -- they usually put the
  29. terminal in raw mode, which disables NL->CR/LF translation.  Also, some
  30. systems seem to leave the console in raw mode when it's not logged in.
  31. -- 
  32. Barry Margolin
  33. System Manager, Thinking Machines Corp.
  34.  
  35. barmar@think.com          {uunet,harvard}!think!barmar
  36.