On Mon, Dec 28, 2009 at 10:45:51PM -0800, Philip Guenther wrote:
> $ printf 'foo\\\\bar\n'
> foo\\bar
> $ printf 'foo\\\\bar\n' | { read -r foo; echo "$foo"; }
> foo\bar

That's backslash interpretation performed by the echo shell builtin.
For example:

$ echo 'foo\\bar'
foo\bar
$ echo -E 'foo\\bar'
foo\\bar
$ printf '%s\n' 'foo\\bar'
foo\\bar

> $ bash
> bash-4.0$ printf 'foo\\\\bar\n' | { read -r foo; echo "$foo"; }
> foo\\bar

In bash, the echo shell builtin seems to have opposite defaults than the
one in ksh:
$ bash
$ echo -e 'foo\\bar'
foo\bar

Ciao,
        Kili

Reply via email to