Hi Viktor,

> >     ['p', 'r', 'i', 'n', 't', 'f', ' ', "'", 'H', 'e', 'l', 'l', 'o',
> >         '\\', '"', '\\', 'n', "'"]
...
> > It's the «\\» before the «\"» causing the problem;  it's
> > unspecified.  One ends up with printf seeing «\"» and my printf(1p)
> > says
> >
> >     The interpretation of a <backslash> followed by any other
> >     sequence of characters is unspecified.
> >
> > Without it, I get consistent results.
> >
> >     $ bash -c "printf 'Hello\"\n'"
> >     Hello"
> >     $ bash -c "printf 'Hello\"\n'" | sha1sum
> >     f8edb41250edb3fea02ea9cb68488b123773b559  -
> >     $ dash -c "printf 'Hello\"\n'" | sha1sum
> >     f8edb41250edb3fea02ea9cb68488b123773b559  -
>
> Using b/dash -c ".." to switch shell is very misleading. Inside
> double-quotes escaped characters loose their backslashes!

Well, that's not quite true, as I showed above.

> Please try with one file each shell:

Or just paste this line into each shell.  It's from the Python list
above.

    printf 'Hello\"\n'

It shows the same problem.  The correct line to paste is

    printf 'Hello"\n'

-- 
Cheers, Ralph.
https://plus.google.com/+RalphCorderoy

Reply via email to