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

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



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



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