help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Looking for something like "errexit" for interactive ses


From: Eric Pruitt
Subject: Re: [Help-bash] Looking for something like "errexit" for interactive sessions
Date: Wed, 28 Aug 2019 09:48:20 -0700
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Aug 28, 2019 at 09:46:31AM -0700, Eric Pruitt wrote:
> On Wed, Aug 28, 2019 at 08:50:08AM -0400, Greg Wooledge wrote:
> > Every command drops the user back to the prompt when it finishes, whether
> > the exit status was 0 or non-zero.
>
> No, it doesn't when errexit is set unless I'm missing something:
>
>     ~$ bash
>     2: ~$ set -e
>     2: ~$ false
>     (1)
>     ~$
>
> The "2" indicates the SHLVL, and as shown, you don't get dropped at a
> prompt when errexit is set during an interactive session. I want a
> feature that works like errexit but returns the user to a functioning
> prompt per my original message:
>
> > > instead of causing the session to exit, it'd drop the user back to a
> > > prompt if a command finished with a non-zero status?

I probably should've included the bit that reads "Is there a **feature
akin to errexit** [...]".

Eric



reply via email to

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