home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:14829 comp.unix.shell:5115
- Newsgroups: comp.unix.questions,comp.unix.shell
- Path: sparky!uunet!nwnexus!Celestial.COM!ray
- From: ray@Celestial.COM (Ray Jones)
- Subject: Re: Redirection of the Echo command to other tty's
- Organization: Celestial Software, Mercer Island, WA
- Date: Sat, 19 Dec 1992 19:00:00 GMT
- Message-ID: <1992Dec19.190000.10285@Celestial.COM>
- References: <1992Dec14.222553.22768@sactoh0.sac.ca.us>
- Keywords: unix echo shell
- Lines: 36
-
- In <1992Dec14.222553.22768@sactoh0.sac.ca.us> dwj@sactoh0.sac.ca.us (Daniel W. James) writes:
-
- >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?
-
- You might try
- echo "Line One
- Line Two" >/dev/console
-
- --
- INTERNET: ray@Celestial.COM Ray A. Jones; Celestial Software
- UUCP: ...!thebes!camco!ray 6641 East Mercer Way
- uunet!camco!ray Mercer Island, WA 98040; (206) 947-5591
- The probability of one or more spelling errors in this missive approaches
-