Re: bug-bash Digest, Vol 236, Issue 5

2022-07-04 Thread Yair Lenga
Greg, I agree with you 100%. Not trying to fix errexit behavior. The new errfail (if accepted) will provide better error handling (via opt-in) without breaking existing code. Yair. Sent from my iPad > On Jul 4, 2022, at 10:00 PM, bug-bash-requ...@gnu.org wrote: > > From: Greg Wooledge > To:

Re: Revisiting Error handling (errexit)

2022-07-04 Thread David
On Mon, 4 Jul 2022 at 22:22, Yair Lenga wrote: > I've tried to look into a minimal > solution that will address the most common pitfall of errexit, where many > sequences (e.g., series of commands in a function) will not properly > "break" with 'errexit'. For example: > > function foo { > cat

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Lawrence Velázquez
On Mon, Jul 4, 2022, at 3:55 PM, Yair Lenga wrote: > I'm sorry - I misunderstood your original comments. I'll prepare the > patched version (at least, I would like to add comments before > publishing...) , and share it. > Where/how can I post it ? Send it to this list as an attachment [1] with a .

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Yair Lenga
Hi Lawrence, I'm sorry - I misunderstood your original comments. I'll prepare the patched version (at least, I would like to add comments before publishing...) , and share it. Where/how can I post it ? I did not see anyone else dropping source code/patches into the group ? Yair On Mon, Jul 4, 20

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Lawrence Velázquez
On Mon, Jul 4, 2022, at 2:33 PM, Yair Lenga wrote: > Thanks for taking the time to review my post. I do not want to start a > thread about the problems with ERREXIT. Neither do I. > Instead, I'm trying to advocate for > a minimal solution. > > [...] > > Please take a look at the specific short ex

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Greg Wooledge
On Mon, Jul 04, 2022 at 09:33:28PM +0300, Yair Lenga wrote: > Thanks for taking the time to review my post. I do not want to start a > thread about the problems with ERREXIT. Instead, I'm trying to advocate for > a minimal solution. Oh? Then I have excellent news. The minimal solution for dealin

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Yair Lenga
Lawrence, Thanks for taking the time to review my post. I do not want to start a thread about the problems with ERREXIT. Instead, I'm trying to advocate for a minimal solution. There are already many threads in bash mailing lists, stack overflow, and numerous articles related to advanced bash prog

Re: [Unknown error when running a simple bash script]

2022-07-04 Thread Greg Wooledge
On Mon, Jul 04, 2022 at 06:15:27PM +0200, Alex fxmbsw7 Ratchev wrote: > On Mon, Jul 4, 2022, 18:07 wrote: > > When I am running the script, it says "[[: not found." You're running the script with sh, not with bash. If you are typing "sh myscript", that immediately identifies the source of the pr

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Lawrence Velázquez
On Mon, Jul 4, 2022, at 8:20 AM, Yair Lenga wrote: > I was able to change Bash source and build a version that supports the new > option 'errfail' (following the 'pipefail' naming), which will do the > "right" thing in many cases - including the above - 'foo' will return 1, > and will NOT proceed t

Re: [Unknown error when running a simple bash script]

2022-07-04 Thread Alex fxmbsw7 Ratchev
On Mon, Jul 4, 2022, 18:07 wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto > -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-secur

[Unknown error when running a simple bash script]

2022-07-04 Thread avni
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -flto=auto -ffat-lto-objects -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux asus-laptop.exa

Re: Revisiting Error handling (errexit)

2022-07-04 Thread Saint Michael
Sounds great to me. I also use Bash for mission-critical processes. Philip On Mon, Jul 4, 2022 at 8:22 AM Yair Lenga wrote: > > Hi, > > In my projects, I'm using bash to manage large scale jobs. Works very well, > especially, when access to servers is limited to ssh. One annoying issue is > the e

Revisiting Error handling (errexit)

2022-07-04 Thread Yair Lenga
Hi, In my projects, I'm using bash to manage large scale jobs. Works very well, especially, when access to servers is limited to ssh. One annoying issue is the error handling - the limits/shortcomings of the 'errexit', which has been documented and discussed to the Nth degree in multiple forums.