Re: errexit is not respected on nested functions when parent function preceeds ||

2023-08-08 Thread Lawrence Velázquez
On Tue, Aug 8, 2023, at 12:04 PM, cirrus.mazurka-0t--- via Bug reports for the GNU Bourne Again SHell wrote: > The following code: > > ``` bash > #!/usr/bin/env bash > > set -Eeuo pipefail > shopt -s huponexit > shopt -s inherit_errexit > > function child_function { > return 1 > } > function

Re: !; is interpreted as an history expansion that can never match anything

2023-08-08 Thread Emanuele Torre
On Tue, Aug 08, 2023 at 03:35:10PM -0400, Chet Ramey wrote: > Anyway, there's a good reason to add ";&|" to the set of characters that > inhibit history expansion if they follow the history expansion character. Thank you! Please also "()<>" if possible. o/ emanuele6

Re: ! history expansion occurs within arithmetic substitutions

2023-08-08 Thread Zachary Santer
On Tue, Aug 8, 2023 at 3:11 PM Dale R. Worley wrote: > But I would not take it as given that nobody would ever want to use > history expanstion within an arithmetic substitution. Let me concoct an > example: > Yeah, that's all fair. Admittedly, I never use history expansion, so I'm not thinking

errexit is not respected on nested functions when parent function preceeds ||

2023-08-08 Thread cirrus . mazurka-0t--- via Bug reports for the GNU Bourne Again SHell
I think I've found a bug with Bash's handling of errexit. The following code: ``` bash #!/usr/bin/env bash set -Eeuo pipefail shopt -s huponexit shopt -s inherit_errexit function child_function { return 1 } function parent_function { child_function echo "parent noticed

Re: !; is interpreted as an history expansion that can never match anything

2023-08-08 Thread Chet Ramey
On 8/8/23 1:43 AM, Emanuele Torre wrote: ! followed by a ; or another terminator is interpreted as an history expansion with no pattern that can never match anything. $ !; echo hi bash: !: event not found $ !&& echo hi bash: !: event not found This is interesting. Bash documents t

Re: ! history expansion occurs within arithmetic substitutions

2023-08-08 Thread Andreas Schwab
On Aug 08 2023, Dale R. Worley wrote: > More troublesome, I think, are several variable substitutions which > include "!" followed by a name. But I doubt they're used much in > interactive mode. The history expansion is smart enough to not interfere with ${!var}. -- Andreas Schwab, sch...@linu

Re: !; is interpreted as an history expansion that can never match anything

2023-08-08 Thread Dale R. Worley
Emanuele Torre writes: > ! followed by a ; or another terminator is interpreted as an history > expansion with no pattern that can never match anything. > > $ !; echo hi > bash: !: event not found > $ !&& echo hi > bash: !: event not found IMHO it is more to the point that in the manual

Re: ! history expansion occurs within arithmetic substitutions

2023-08-08 Thread Dale R. Worley
Zachary Santer writes: > Description: > Similarly, history expansion occurs within arithmetic substitutions. This > will never, ever be what the user wants. And now I know how to make it not > happen. > > Repeat-By: > $ set +o histexpand Well, yes, if you turn off history expansion, then it won'

Re: ! history expansion occurs within arithmetic substitutions

2023-08-08 Thread Martin D Kealey
On Tue, 8 Aug 2023, 23:24 Zachary Santer, wrote: > Description: > Similarly, history expansion occurs within arithmetic substitutions. This > will never, ever be what the user wants. Correction: it will never ever be what YOU want. I can certainly think of uses for history expansion in arithmet

Re: ! history expansion occurs within arithmetic substitutions

2023-08-08 Thread Emanuele Torre
On Tue, Aug 08, 2023 at 09:24:48AM -0400, Zachary Santer wrote: > Configuration Information: > Machine: x86_64 > OS: msys > Compiler: gcc > Compilation CFLAGS: -march=nocona -msahf -mtune=generic -O2 -pipe > -D_STATIC_BUILD > uname output: MSYS_NT-10.0-19045 Zack2021HPPavilion 3.4.7.x86_64 2023-07-

Re: BASH_SUBSHELL is not incrementing when part of a pipeline

2023-08-08 Thread Chet Ramey
On 8/7/23 9:56 AM, Kamil Cukrowski Priv wrote: Hi, when BASH_SUBSHELL is part of a pipeline with just a simple command it does not increment. Consider the following: Yes. BASH_SUBSHELL increments for asynchronous commands (&), commands explicitly in subshells, compound commands in pipelines, co

! history expansion occurs within arithmetic substitutions

2023-08-08 Thread Zachary Santer
Configuration Information: Machine: x86_64 OS: msys Compiler: gcc Compilation CFLAGS: -march=nocona -msahf -mtune=generic -O2 -pipe -D_STATIC_BUILD uname output: MSYS_NT-10.0-19045 Zack2021HPPavilion 3.4.7.x86_64 2023-07-14 16:57 UTC x86_64 Msys Machine Type: x86_64-pc-msys Bash Version: 5.2 Patch