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

Re: exit to shell from nested function calls.



On Thu, May 16, 2024 at 4:22 PM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
> [...]
>
> ... the above is part of a function hierarchy can can be four
> levels deep and if there's an error (it's being debugged so there's
> error tests everywhere), I need these 'return 1 ... return 1 ...
> return 1 ... return 1 ... to break back to the shell.

I'd turn this into a script (executable file) and use exit to bail
out. IMO, anything that can be a script is better off as a script.
Programming within the interactive shell is hard enough with all the
aliases, non-standard options and whatnot. No need to inject more code
into it than necessary.

Roman.




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