Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: sh compatibility again :->

>Right; if I recall correctly, bash and ksh both permit stuff like:
>$ echo "foo `echo "bar baz"` boing"
>That is, bash and ksh nest double quotes inside backticks.  Old-fashioned
>Bourne shell, on the other hand, does NOT permit nesting of double quotes,
>even inside backticks.
>The only way to resolve this would be with yet another option, SH_QUOTES
>or some such.  Worth it?  Dunno.

Not worth it.  POSIX leaves the behaviour undefined IIRC, and there's
no advantage in the traditional behaviour.

>} I'll try to write a configure check for the echo style of /bin/sh and use
>} that.
>Eww, no.  Let's pick one behavior and stick with it, please.  The default
>options, even in an emulation mode, shouldn't vary from one installation
>to the next!  It's been a long time since I encountered an sh that didn't
>have a builtin SysV-style echo -- BSD_ECHO is needed mostly for csh
>compatibility.  I'd vote for leaving BSD_ECHO off when run as "sh".

I also recommend against a configure check, but for a different reason:
some widespread shs (notably SunOS and Solaris) vary their echo
behaviour depending on $PATH, trying to emulate what would happen if
echo weren't a builtin.  It's really quite difficult to reliably detect
this behaviour.  I suggest that the behaviour should remain as it is.


Messages sorted by: Reverse Date, Date, Thread, Author