[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Looking for something like "errexit" for interactive ses
Re: [Help-bash] Looking for something like "errexit" for interactive sessions
Wed, 28 Aug 2019 09:46:31 -0700
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:
2: ~$ set -e
2: ~$ false
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?