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

  1. Xref: sparky comp.unix.questions:14829 comp.unix.shell:5115
  2. Newsgroups: comp.unix.questions,comp.unix.shell
  3. Path: sparky!uunet!nwnexus!Celestial.COM!ray
  4. From: ray@Celestial.COM (Ray Jones)
  5. Subject: Re: Redirection of the Echo command to other tty's
  6. Organization: Celestial Software, Mercer Island, WA
  7. Date: Sat, 19 Dec 1992 19:00:00 GMT
  8. Message-ID: <1992Dec19.190000.10285@Celestial.COM>
  9. References: <1992Dec14.222553.22768@sactoh0.sac.ca.us>
  10. Keywords: unix echo shell 
  11. Lines: 36
  12.  
  13. In <1992Dec14.222553.22768@sactoh0.sac.ca.us> dwj@sactoh0.sac.ca.us (Daniel W. James) writes:
  14.  
  15. >Unlike my usual questions, this one is quick, and hopefully the answer will
  16. >be just as easy :)
  17.  
  18. >Let's say I type the following shell command: (SysV)
  19. >----------------------------------------------------
  20. >$ echo "Line One\nLine Two"
  21. >I get the following output on *my* screen:
  22. >----------------------------------------------------
  23. >Line One
  24. >Line Two
  25.  
  26. >However, if I type:
  27. >----------------------------------------------------
  28. >$ echotest.sh > /dev/console
  29. >I get the following output on the console:
  30. >----------------------------------------------------
  31. >Line One
  32. >        Line Two
  33.  
  34. >I.E., during redirection, the \n changes from cr/lf to just lf
  35.  
  36. >Do I need to use echo "Line One\n\rLine Two" during redirection???  Or is
  37. >there some easier way (independent of redirection) to make sure the both
  38. >the CR/LF sequence is output?
  39.  
  40. You might try
  41. echo "Line One
  42. Line Two" >/dev/console
  43.  
  44. -- 
  45. INTERNET:  ray@Celestial.COM   Ray A. Jones; Celestial Software
  46. UUCP:   ...!thebes!camco!ray   6641 East Mercer Way
  47.              uunet!camco!ray   Mercer Island, WA 98040; (206) 947-5591
  48. The probability of one or more spelling errors in this missive approaches
  49.