Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: backslash problems?



John Cooper wrote:
>$ echo "foo\bar\baz"
>foaaz

echo gets the argument 'foo\bar\baz', and translates '\b' to backspace.

>$ echo "foo\\bar\\baz"
>foaaz
>$ echo 'foo\bar\baz'
>foaaz

Same.

>$ echo 'foo\\bar\\baz'
>foo\bar\baz

echo gets the argument 'foo\\bar\\baz', and translates '\\' to '\'.

>bash$ echo "foo\bar\baz"
>foo\bar\baz

This echo desn't translate '\b'.  Use "setopt BSD_ECHO" to get this
behaviour under zsh.

-zefram



Messages sorted by: Reverse Date, Date, Thread, Author