Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: return builtin to end a script
- X-seq: zsh-workers 52548
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: return builtin to end a script
- Date: Fri, 16 Feb 2024 14:24:45 +0000 (GMT)
- Archived-at: <https://zsh.org/workers/52548>
- Importance: Normal
- In-reply-to: <20240216125826.GA96417@qaa.vinc17.org>
- List-id: <zsh-workers.zsh.org>
- References: <20240216125826.GA96417@qaa.vinc17.org>
> On 16/02/2024 12:58 GMT Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
>
>
> The return builtin is currently specified only for shell functions
> and "." scripts, while it would also be useful to end a script,
> for instance to be able to use zsh script both as commands (e.g.
> from non-zsh shells) and as autoloaded functions in zsh.
>
> So I think that it would be useful to extend it to end a script.
I remember adding this a long time ago now.
% zsh <<<'echo Hello
quote> return
quote> echo Goodbye'
Hello
It looks like the documentation is defective.
pws
>
> --
> Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author