I have a configure script that is failing a test on openbsd because of
an escaping problem.  I am not sure if the configure script is wrong,
or if /bin/sh on openbsd is misbehaving, although I think its the
configure script.

The problem is with a \" becoming just a " when doing a cat<<EOF:

$ cat<<EOF
> \z
> EOF
\z
$ cat<<EOF
> \"
> EOF
"

With bash it looks like this:
bash-3.00$ cat<<EOF
> \z
> EOF
\z
bash-3.00$ cat<<EOF
> \"
> EOF
\"

Of course the developers of this software think bash is right, and
their configure script actually restarts itself with bash if its found,
so they haven't really tested anything besides bash I don't think.  I
am guessing that openbsd's sh is correct, since if you want escaped
chars left alone you are supposed to do:

$ cat<<\EOF 
> \"
> EOF
\"

which works fine.  Can anyone confirm for sure wether the configure
script is wrong or if sh should be leaving the \" alone?

Thanks
Adam

Reply via email to