On Fri, 5 Apr 2013, Thorsten Glaser wrote:
>
> What mksh does here is:
>
> . Save a pointer to the current "variable locality scope" as l_expand
> . Create a new subscope called l_assign
> . Evaluate "foo" inside l_expand, store as cp
> . Assign cp to "a" inside l_assign
> . Run ":" with l_assign "on top"
> . Discard l_assign
> . Now l_expand is "on top" again, as it was before we started.
That would produce the result that I had expected, which was the result
that bash produced. Does your mksh give a different result than the result
I posted from my mksh build?
>
> What effects precisely?
"exec $special_builtin_command" generates an error in bash, but not in
mksh, as in the examples I posted. The question was, what does POSIX say
about it.
>
> Sure, I'll prod bonsaikitten later. Does Gentoo have a recent (2.x)
> klibc packaged including the "klcc" compiler wrapper?
Yes.
#
# ACCEPT_KEYWORDS=~x86 emerge -pv klibc
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild N ] dev-libs/klibc-2.0.2 USE="-debug {-test}" 0 kB
Total: 1 package (1 new), Size of downloads: 63,997 kB
# ebuild /usr/portage/dev-libs/klibc/klibc-2.0.2.ebuild clean compile install
...
# find /var/tmp/portage/dev-libs/klibc-2.0.2/image -name klcc
/var/tmp/portage/dev-libs/klibc-2.0.2/image/usr/bin/klcc
#
As well as "static", Gentoo ebuilds sometimes implement a "minimal" USE
flag that may generate packages with some features (or bloat) omitted.
Finn