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