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

Re: [BUG] 'exec' runs shell functions and builtins



On Friday, August 11, 2017 16:25:01 Peter Stephenson wrote:
> On Fri, 11 Aug 2017 17:10:12 +0200
> 
> Kamil Dudka <kdudka@xxxxxxxxxx> wrote:
> > It is good that zsh does not need this in its native configuration but
> > how is it supposed to work in the POSIX emulation mode now?
> > 
> > % (exec cd)
> > % emulate sh
> > % (exec cd)
> > zsh: command not found: cd
> > 
> > If I understand http://www.zsh.org/mla/workers/2017/msg01138.html
> > correctly, then the above command should work?
> 
> I can't actually think of a useful application of the above that would
> make "work" meaningful.  What's the "exec" supposed to be doing?  Who
> would even try to exec a builtin, even if they discover that for some
> bizarre reason the standard says you can?  The one possible use of
> "exec" in that case might be to ensure you're *not* using a builtin ---
> but apparently you are?  What?
> 
> pws

Thanks for the reply!  It did not make much sense to me either but I am by
no means expert in this area.  In fact I hoped to hear some explanation on 
this list because the topic had been raised here recently.  Given the lack
of information about the reasoning behind the strange POSIX requirement, I 
agree to keep the behavior of zsh as it is now.

Kamil



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