help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] equivalent of set -e for function


From: Daniel Mills
Subject: Re: [Help-bash] equivalent of set -e for function
Date: Tue, 4 Dec 2018 11:18:46 -0500

On Tue, Dec 4, 2018 at 10:58 AM Peng Yu <address@hidden> wrote:

> Hi,
>
> I'd like to return from a function upon getting an error from a
> command in that function. It seems that `set` does have an option like
> -r for this feature. Does bash support this feature via some other
> setup command? Thanks.
>
> --
> Regards,
> Peng
>
>
:Just use some_command || return, though I guess you could do it with an
ERR trap. trap return ERR


reply via email to

[Prev in Thread] Current Thread [Next in Thread]