John H. Robinson, IV wrote:

Ralph Shumaker wrote:
I got echo -n to work just fine. But I cannot figure out how to get echo -e Some text.\n to work. I tried to use -E, but no change. echo -e \r doesn't work either. What gives?

\ is meaningful to the shell. To pass \ to echo, you need to escape it,
or put it in quotes:

[EMAIL PROTECTED]:~]% echo -e some text \\nmoo
some text moo [EMAIL PROTECTED]:~]% echo -e 'some text \nmoo' some text moo [EMAIL PROTECTED]:~]% echo -e "some text \nmoo" some text moo

-john


Thanks to all who responded on this. (I'll be looking at printf thanks to Carl. Thank you Carl & Gregory for the heads up on the different versions of echo .)

Thanks Andrew for the bit about quoting. And thank you John for expanding upon it.

It is working, now that  \r  and  \n  are inside quotes.


--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-list

Reply via email to