Christian Weisgerber, 07 Apr 2016 15:41:
> As ksh(1) explains under "POSIX mode":
> 
>   o  Occurrences of \" inside double quoted `..` command substitutions.
>      In POSIX mode, the \" is interpreted when the command is interpreted;
>      in non-POSIX mode, the backslash is stripped before the command
>      substitution is interpreted.  For example, echo "`echo \"hi\"`"
>      produces ``"hi"'' in POSIX mode, ``hi'' in non-POSIX mode.  To avoid
>      problems, use the $(...) form of command substitution.
> 
> The configure script switches the shell into POSIX mode (set -o posix),
> but expects the other behavior.
> 
> To illustrate:
> $ sh          -c 'echo "`echo \"hi\"`"'
> hi
> $ sh -o posix -c 'echo "`echo \"hi\"`"'
> "hi"
>
> The problem is that our sh's idea of POSIX-mandated behavior diverges
> in this regard from that of other popular shells like bash or FreeBSD
> sh.  I think it's time to change our shell.  I'll send something
> to tech@ later tonight.

great catch.
but why set posix mode and then expect the opposite?

-f
-- 
30 minutes of begging is not considered foreplay.

Reply via email to