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

  1. Xref: sparky comp.unix.questions:14690 comp.unix.shell:5064
  2. Newsgroups: comp.unix.questions,comp.unix.shell
  3. Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!pacbell.com!pacbell!sactoh0!dwj
  4. From: dwj@sactoh0.sac.ca.us (Daniel W. James)
  5. Subject: Redirection of the Echo command to other tty's
  6. Message-ID: <1992Dec14.222553.22768@sactoh0.sac.ca.us>
  7. Keywords: unix echo shell 
  8. Reply-To: ccpoabt!dan@sactoh0.SAC.CA.US (Daniel James)
  9. Organization: CCPOA Benefit Trust Fund
  10. Date: Mon, 14 Dec 92 22:25:53 GMT
  11. Lines: 39
  12.  
  13. Unlike my usual questions, this one is quick, and hopefully the answer will
  14. be just as easy :)
  15.  
  16. Let's say I type the following shell command: (SysV)
  17. ----------------------------------------------------
  18. $ echo "Line One\nLine Two"
  19. I get the following output on *my* screen:
  20. ----------------------------------------------------
  21. Line One
  22. Line Two
  23.  
  24. However, if I type:
  25. ----------------------------------------------------
  26. $ echotest.sh > /dev/console
  27. I get the following output on the console:
  28. ----------------------------------------------------
  29. Line One
  30.         Line Two
  31.  
  32. I.E., during redirection, the \n changes from cr/lf to just lf
  33.  
  34. Do I need to use echo "Line One\n\rLine Two" during redirection???  Or is
  35. there some easier way (independent of redirection) to make sure the both
  36. the CR/LF sequence is output?
  37.  
  38. Also, I found some neat little files which are just a sequence of
  39. characters/vt100 escape codes which when 'cat' display neat christmas
  40. scenes.  However, if I redirect these, they also do not display correctly.
  41. Is there any way besides first piping the output to a sed script to
  42. translate the LF to a CR/LF sequence before redirecting the output?
  43.  
  44. Thanks in advance...
  45. Dan.
  46.  
  47. -- 
  48. _______________________________________________________________________________
  49. Daniel W. James      In Cal: (800) 468-6486 |  ccpoabt!dan@sactoh0.SAC.CA.US
  50. CCPOA Benefit Trust Fund     (916) 923-6080 | ...!pacbell!sactoh0!ccpoabt!dwj
  51. 3780 Rosin Court, Suite 250                 +----------------------------------
  52.