Micah Cowan wrote:
> Andrew Panin wrote:
> > I can't make echo to show \n and \r symbols. According to 'man echo',
> > there's a way to do this by using '-e' option.
> > 
> > However, this doesn't help. Doesn't even matter which option I choose
> > (even 'echo -e \015'), it just shows '015' literally.
> 
> More likely, shell interpretation. The shell will turn a bare \015 into
> 015. Try quoting it, such as with '\015' or \\015.

Of course using the octal escapes works.  But this is a non-portable
use of echo.  I do still use echo often but only for simple strings.

For printing escape sequences the recommended program is 'printf'.
See the "RATIONALE" section here:

  http://www.opengroup.org/onlinepubs/009695399/utilities/printf.html

Bob


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to