home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:14690 comp.unix.shell:5064
- Newsgroups: comp.unix.questions,comp.unix.shell
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!pacbell.com!pacbell!sactoh0!dwj
- From: dwj@sactoh0.sac.ca.us (Daniel W. James)
- Subject: Redirection of the Echo command to other tty's
- Message-ID: <1992Dec14.222553.22768@sactoh0.sac.ca.us>
- Keywords: unix echo shell
- Reply-To: ccpoabt!dan@sactoh0.SAC.CA.US (Daniel James)
- Organization: CCPOA Benefit Trust Fund
- Date: Mon, 14 Dec 92 22:25:53 GMT
- Lines: 39
-
- Unlike my usual questions, this one is quick, and hopefully the answer will
- be just as easy :)
-
- Let's say I type the following shell command: (SysV)
- ----------------------------------------------------
- $ echo "Line One\nLine Two"
- I get the following output on *my* screen:
- ----------------------------------------------------
- Line One
- Line Two
-
- However, if I type:
- ----------------------------------------------------
- $ echotest.sh > /dev/console
- 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
-
- Do I need to use echo "Line One\n\rLine Two" during redirection??? Or is
- there some easier way (independent of redirection) to make sure the both
- the CR/LF sequence is output?
-
- Also, I found some neat little files which are just a sequence of
- characters/vt100 escape codes which when 'cat' display neat christmas
- scenes. However, if I redirect these, they also do not display correctly.
- Is there any way besides first piping the output to a sed script to
- translate the LF to a CR/LF sequence before redirecting the output?
-
- Thanks in advance...
- Dan.
-
- --
- _______________________________________________________________________________
- Daniel W. James In Cal: (800) 468-6486 | ccpoabt!dan@sactoh0.SAC.CA.US
- CCPOA Benefit Trust Fund (916) 923-6080 | ...!pacbell!sactoh0!ccpoabt!dwj
- 3780 Rosin Court, Suite 250 +----------------------------------
-