Re: sh problem or configure script problem?
On 2005-08-22 17:53:37 -0500, Dave Feustel wrote: of pdksh. Of course, if korn shell's behaviour doesn't conform to Posix, *then* what do you do. (I personally take Korn shell as THE standard You test on a certified Unix system, i.e. AIX, HP or Solaris. Best Martin -- http://www.tm.oneiros.de
sh problem or configure script problem?
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 catEOF: $ catEOF \z EOF \z $ catEOF \ EOF With bash it looks like this: bash-3.00$ catEOF \z EOF \z bash-3.00$ catEOF \ 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
Re: sh problem or configure script problem?
On Mon, Aug 22, 2005 at 04:28:23PM -0400, Adam Montague wrote: [unquoted here-documents] [...] $ 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? From 1003.1, section about here-documents: | If no characters in word are quoted, all lines of the here-document | shall be expanded for parameter expansion, command substitution, | and arithmetic expansion. In this case, the backslash in the input | behaves as the backslash inside double-quotes (see Double-Quotes). So far, the pdksh shipped with OpenBSD seems to be correct. But... | However, the double-quote character ( ' )' shall not be treated ^^ probably a typo. | specially within a here-document, except when the double-quote | appears within $(), ``, or ${}. IMHO this doesn't apply for the previous statement about backslashes. However it's interesting that ksh version M 1993-12-28 p (shipped, e.g., with MacOS X) has different semantics (i.e., \ is kept verbatim within an unquoted here-document). Maybe a misinterpretation of POSIX? Ciao, Kili
Re: sh problem or configure script problem?
On Monday 22 August 2005 17:24, Matthias Kilian wrote: However it's interesting that ksh version M 1993-12-28 p (shipped, e.g., with MacOS X) has different semantics (i.e., \ is kept verbatim within an unquoted here-document). Maybe a misinterpretation of POSIX? If you want to conduct an acid test, get the source for korn shell from korn.com, build it and then compare its scripted behavior against that of pdksh. Of course, if korn shell's behaviour doesn't conform to Posix, *then* what do you do. (I personally take Korn shell as THE standard regardless of what Posix says.) Dave Feustel -- Tired of having to defend against Malware? (You know: trojans, viruses, SPYWARE, worms and popups) Then Switch to OpenBSD with a KDE desktop!!!
Re: sh problem or configure script problem?
On Aug 22, 2005, at 5:53 PM, Dave Feustel wrote: If you want to conduct an acid test, get the source for korn shell from korn.com, build it and then compare its scripted behavior against that For the archives, that's kornshell.com :) korn.com is for the band.