Re: Revisiting Error handling (errexit)

2022-07-08 Thread Yair Lenga
Greetings, First, I wanted to thank all the people that took the time to provide comments on the proposed improvements to the error handling. I believe that the final proposal is ready for evaluation (both behavior and implementation). Summary: * Proposing adding new option 'errfail' (sh -o errfa

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Oğuz
8 Temmuz 2022 Cuma tarihinde Yair Lenga yazdı: > > Practical Example - real life. A job has to copy 3 critical data files. It > then sends notification via email (non-critical). > > #! /bin/bash > set -o errfail > function copy-files { > # ALL files are critical, script will not cont > c

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Alex fxmbsw7 Ratchev
On Fri, Jul 8, 2022, 12:23 Oğuz wrote: > 8 Temmuz 2022 Cuma tarihinde Yair Lenga yazdı: > > > > Practical Example - real life. A job has to copy 3 critical data files. > It > > then sends notification via email (non-critical). > > > > #! /bin/bash > > set -o errfail > > function copy-files { > >

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Kerin Millar
On Fri, 8 Jul 2022 13:22:46 +0300 Oğuz wrote: > 8 Temmuz 2022 Cuma tarihinde Yair Lenga yazdı: > > > > Practical Example - real life. A job has to copy 3 critical data files. It > > then sends notification via email (non-critical). > > > > #! /bin/bash > > set -o errfail > > function copy-files

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Koichi Murase
2022年7月8日(金) 19:29 Alex fxmbsw7 Ratchev : > > > ls -l /production/path | mail -s "all-good" not...@company.com || > > > true# Not critical > > > > small side note there, a || true is big slow imho What does it mean? If you are talking about the execution time, "|| true" is much faster tha

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Yair Lenga
Oğuz, Thanks for time to take a look at my proposal. I believe that you brought an excellent question - which many readers will be asking themselves. I opted for longer answer - given the importance of this questions. While you can achieve results similar to 'errfail' with existing bash commands

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Alex fxmbsw7 Ratchev
On Fri, Jul 8, 2022, 12:44 Koichi Murase wrote: > 2022年7月8日(金) 19:29 Alex fxmbsw7 Ratchev : > > > > ls -l /production/path | mail -s "all-good" not...@company.com > || > > > > true# Not critical > > > > > > > small side note there, a || true is big slow imho > > What does it mean? If you

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Greg Wooledge
On Fri, Jul 08, 2022 at 01:52:04PM +0300, Yair Lenga wrote: > While you can achieve results similar to 'errfail' with existing bash > commands (you will need more than && !), the required effort is not > practical: > * Consider a common scenario (for me) - a script with 1000 lines, complex > logic,

Re: Revisiting Error handling (errexit)

2022-07-08 Thread Martin D Kealey
The old errexit explicitly exempts any command prefaced by ! which is important so that one can write ! (( x++ )) without it blowing up when x is 0 and without paying the penalty for "|| true". Does this new proposal honour that? Aside from that, I still think that yet another global setting is p

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-08 Thread Chet Ramey
On 7/7/22 12:11 PM, Steffen Nurpmeso wrote: Hello! Hi. Funnily my parser has only one (what i know) problem left, the same as bash. On the other hand i found more. The thing about all of this is that these are operators, and so delimit tokens. Whitespace is siginficant only when determini

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-08 Thread Steffen Nurpmeso
Hello. Chet Ramey wrote in <9b6dfdc2-ade9-16ad-8960-5b2887b35...@case.edu>: |On 7/7/22 12:11 PM, Steffen Nurpmeso wrote: |> Funnily my parser has only one (what i know) problem left, the |> same as bash. On the other hand i found more. | |The thing about all of this is that these are operat

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-08 Thread Steffen Nurpmeso
Steffen Nurpmeso wrote in <20220708150300.spmo7%stef...@sdaoden.eu>: ... |(I post my test -- as of now, i do not yet support ?: --, we What i meant was "i _could_ post my test". I mean, it is just a series of nonsense, and not even complete yet. (In the internet as part of my MUA. Ah, sigh, l

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-08 Thread Chet Ramey
On 7/8/22 11:03 AM, Steffen Nurpmeso wrote: Hello. Chet Ramey wrote in <9b6dfdc2-ade9-16ad-8960-5b2887b35...@case.edu>: |On 7/7/22 12:11 PM, Steffen Nurpmeso wrote: |> Funnily my parser has only one (what i know) problem left, the |> same as bash. On the other hand i found more. | |

Re: [bug] Bind + readline state corruption

2022-07-08 Thread Chet Ramey
On 7/5/22 1:37 PM, Hans Kristian Otnes Berge wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: When modifying READLINE_LINE the substitution works but when returned to the command line, either bash or the tty has lost its state so further attempts to edit the c

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-08 Thread Robert Elz
Date:Fri, 8 Jul 2022 12:08:38 -0400 From:Chet Ramey Message-ID: | This is where folks like kre are going to argue. Am I? I was keeping out of this one! As long as valid expressions are parsed correctly, I don't think it really matters all that much what you do

Re: Parallelization of shell scripts for 'configure' etc.

2022-07-08 Thread Simon Josefsson via Bug reports for the GNU Bourne Again SHell
Tim Rühsen writes: > a) The maintainer/contributor/hacker setup > This is when you re-run configure relatively often for the same project(s). > I do this normally and and came up with > https://gitlab.com/gnuwget/wget2/-/wikis/Developer-hints:-Increasing-speed-of-GNU-toolchain. > > It may be a

Re: Parallelization of shell scripts for 'configure' etc.

2022-07-08 Thread Alex Ameen
I've been telling folks about the config site file every time this thread comes up. Good on you for actually trying it haha. It can make a huge difference. You can short circuit a lot of checks this way. Now, the disclaimer: you still shouldn't share a cache file between projects, and if you use

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-08 Thread Martin D Kealey
On Sat, 9 Jul 2022, 02:08 Chet Ramey, wrote: > On 7/8/22 11:03 AM, Steffen Nurpmeso wrote: > > > So you seem to use your own itoa, and here is (another) bash bug. > > Yeah, that's where stricter integer constant parsing would flag an error. > It's just an extension; bash handles everything POSIX