On Thu, 4 Apr 2013, Thorsten Glaser wrote:

> Finn Thain dixit:
> 
> >The mksh man page says, "the assignments are in effect only for the 
> >duration of the command". In bash you might do,
> 
> Yes, that's POSIX-mandated for special builtin utilities or 
> somesuch-worded.
> 
> >So is ":" a NOP, or is it a builtin command? Beats me!
> 
> ":" is a builtin utility and the same as "true", except that ":" is "a 
> POSIX special builtin" and "true" is "a POSIX regular builtin"

In concept at least, the mksh interpretation of "exec :" is consistent 
with the bash interpretation of "a=foo :" that is, ":" interpreted as 
"builtin".

And the mksh interpretation of "a=foo :" is consistent with the bash 
interpretation of "exec :" -- that is, ":" interpreted as no command at 
all.

To my mind, neither mksh or bash is consistent with itself. (So many ways 
to do nothing!)

Does POSIX also mandate the effects of "exec" when applied to a special 
builtin command? I didn't find it in the opengroup.org documentation.

> 
> Oh, and try mksh-static (on Debian) or roll your own;

Would be nice if the Gentoo ebuild implemented the "static" USE flag...

Finn

Reply via email to