Re: Execution of subsequent commands after a command crashes.
From:
Félix Hauri
Subject:
Re: Execution of subsequent commands after a command crashes.
Date:
Tue, 3 Feb 2026 09:04:30 +0100
You missed a subshell test:
Le Mon, Feb 02, 2026 at 09:22:04PM +0800, 王伟 a écrit :
> #!/usr/bin/env bash
> ...
> { test_crash ; } || echo "case 4"
( test_crash ) || echo "case 5"
>
> exit 0
>
This one will work file as error will happen in a subprocess, and
after closing parenthesis, result code will be passed normally.
--
Félix Hauri - <felix@f-hauri.ch> - http://www.f-hauri.ch