Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: What is distinct about exec of a builtin?
- X-seq: zsh-users 23597
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: What is distinct about exec of a builtin?
- Date: Fri, 31 Aug 2018 15:42:36 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=EOAxa8Rw5jEyrmW2YurvFiXEBF2GvreQNCvcaSpT5zs=; b=CumteTepQBcd06G2C/GuiMLgJS3amAryXPuJXPVIEu0hel95coUS+pUN8H7LZCyEt5 wGJy9z7mEhAO7DnmRPM3MoUJVV53BPozMbb8hq2dhqkb/eoszLNLG70ztwfjpA/bHk34 CDQStzsvIEl+mKxZcCfA87ghcqtGCuN1qMsxqfqSltIA2Q/hojHYY5ur6RbhfiXqb0QL nh/5nXvzZBve5bV+HP/34ukuTeXQbBb1mq4BYue5Yw2qavou/g68dPyMTlrRwZ8d2Ni6 EGlDfo64EdJLn+lMSiSCEXSJQexr5O90TgcyoI3Wq4dW1Z5Iorg8IDCWC5vAO0Pbe9P+ xRXw==
- In-reply-to: <CAKc7PVDT9TvD1w+zHSp6LJHM+f_+5AQ9JRqkwH4Q0RVsGcbuOg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDT9TvD1w+zHSp6LJHM+f_+5AQ9JRqkwH4Q0RVsGcbuOg@mail.gmail.com>
On Fri, Aug 31, 2018 at 2:13 AM, Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
> reading the source I've noted that one can exec builtin. Tested `exec
> type -w run-help`, it worked and shell quickly exited. I wonder what
> can this functionality be used for? Is there anything distinct about
> exec'ing a builtin?
There's nothing magic about this (although ISTR it was changed to work
differently / not at all when POSIX_BUILTINS, fairly recently).
Using "exec" just means that the shell will exit once the builtin has
completed. It's there so that if you exec something you think is an
external command but it turns out to have been supplanted by a
builtin, the shell will still behave as if something external had been
execve()'d.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author