Re: yet another $(case ... parse bug

2024-06-21 Thread felix
Le Thu, May 23, 2024 at 08:19:49PM +0300, Oğuz a écrit : > > $ bash -c 'for (( $(case x in x) esac);; )); do :; done' >From there, I've tested: bash-5.3-alpha$ uname=1 bash-5.3-alpha$ echo $(( uname - $(echo 1) )) 0 bash-5.3-alpha$ echo $(( uname - $(case x in x) echo 1;exit;;esac;echo 0)

Re: proposed BASH_SOURCE_PATH

2024-06-21 Thread alex xmb sw ratchev
bash xmb.mepath declare -- mef="/data/data/com.termux/files/home/xmb.mepath" declare -- med="/data/data/com.termux/files/home" On Wed, Jun 19, 2024, 10:05 PM Will Allan wrote: > > Not sure how common but this is what makes sense. Or name sourceables > > foo.sh, bar.sh and executables foo, bar so

Re: proposed BASH_SOURCE_PATH

2024-06-21 Thread Martin D Kealey
I support BASH_SOURCE_PATH as replacing the normal PATH search only for "." and "source". In addition I propose some new '~' expansions which will give concise expression of dirname+realpath without penalizing code that does not need it. The primary intention is to allow the "standard preamble" t

STRTOLD_BROKEN test fails with gcc14

2024-06-21 Thread af
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: solaris2.11 Compiler: /opt/gcc-14/bin/gcc Compilation CFLAGS: -O2 -fno-omit-frame-pointer -fno-aggressive-loop-optimizations -fstack-protector-strong -gdwarf-2 -gstrict-dwarf -I/usr/include/ncurses -gdwarf-2 -

Re: proposed BASH_SOURCE_PATH

2024-06-21 Thread konsolebox
On Fri, Jun 21, 2024 at 10:01 PM Martin D Kealey wrote: > > I support BASH_SOURCE_PATH as replacing the normal PATH search only for "." > and "source". > > In addition I propose some new '~' expansions which will give concise > expression of dirname+realpath without penalizing code that does not

Re: bash crashes when splitcurl script try download non existent file

2024-06-21 Thread Chet Ramey
On 6/18/24 6:49 PM, Mikhail Gavrilov wrote: Hi, bash crashes when splitcurl script try download non existent file Here is script: https://github.com/axelabs/splitcurl/blob/master/splitcurl Example which is triggers crash: ./splitcurl "ftp://test.rebex.net/no-file"; 10 fish: Job 1, './splitcur

Re: bash crashes when splitcurl script try download non existent file

2024-06-21 Thread Mikhail Gavrilov
On Fri, Jun 21, 2024 at 10:06 PM Chet Ramey wrote: > > It's a bug in the script. If you want to run `kill 0', which sends SIGTERM, > from a SIGTERM trap handler, you need to reset the SIGTERM trap to the > default before doing so. > > Bash allows recursive trap handlers. > > What's happening is yo

Re: bash crashes when splitcurl script try download non existent file

2024-06-21 Thread Chet Ramey
On 6/21/24 1:26 PM, Mikhail Gavrilov wrote: On Fri, Jun 21, 2024 at 10:06 PM Chet Ramey wrote: It's a bug in the script. If you want to run `kill 0', which sends SIGTERM, from a SIGTERM trap handler, you need to reset the SIGTERM trap to the default before doing so. Bash allows recursive trap

Re: bash crashes when splitcurl script try download non existent file

2024-06-21 Thread Greg Wooledge
On Fri, Jun 21, 2024 at 22:26:07 +0500, Mikhail Gavrilov wrote: > On Fri, Jun 21, 2024 at 10:06 PM Chet Ramey wrote: > > Bash allows recursive trap handlers. > > Ok. But it's very suspicious for me because the script ended without > any issues on macOS. > > mikhail@MBP-Mikhail ~> ./splitcurl.sh

Re: set -a leads to truncated output from ps

2024-06-21 Thread Chet Ramey
On 6/15/24 10:28 AM, Oğuz wrote: Yes. All I'm saying is, a variable that affects how certain programs behave when exported should not be implicitly exported by the shell, the user should do it manually if he wants. This is a non-sequitur -- the entire reason for using `set -a' is to have every

Re: set -a leads to truncated output from ps

2024-06-21 Thread Chet Ramey
On 6/15/24 9:48 AM, Koichi Murase wrote: However, for the portable scripts, I now agree that it is a problem that Bash seems to enable `checkwinsize' even in the POSIX mode. Why? POSIX doesn't standardize shopt or the checkwinsize behavior; the shell is free to do whatever it wants. -- ``The

Re: set -a leads to truncated output from ps

2024-06-21 Thread Chet Ramey
On 6/14/24 3:28 AM, Alain BROSSARD wrote: COLUMN is clearly meant to be an internal variable of bash given the description of how it is used; This is definitely not the case. The man page describes how bash uses it, but many other programs use it as well. -- ``The lyf so short, the craft

Re: set -a leads to truncated output from ps

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 8:58 PM Chet Ramey wrote: > On 6/15/24 10:28 AM, Oğuz wrote: > > > Yes. All I'm saying is, a variable that affects how certain programs > > behave when exported should not be implicitly exported by the shell, > > the user should do it manually if he wants. > > This is a non-

Re: REQUEST - bash floating point math support

2024-06-21 Thread Chet Ramey
On 6/17/24 8:04 AM, Zachary Santer wrote: On Mon, Jun 17, 2024 at 3:48 AM Léa Gris wrote: Le 17/06/2024 à 09:17, Koichi Murase écrivait : declare -i numvar=${localeFormatted/[!0-9]/.} This would break with negative numbers. I know no other radix separator than comma or dot. If there ar

Re: REQUEST - bash floating point math support

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 9:58 PM Chet Ramey wrote: > On 6/17/24 8:04 AM, Zachary Santer wrote: > > On Mon, Jun 17, 2024 at 3:48 AM Léa Gris wrote: > >> > >> Le 17/06/2024 à 09:17, Koichi Murase écrivait : > >>> declare -i numvar=${localeFormatted/[!0-9]/.} > >> > >> This would break with negati

Re: REQUEST - bash floating point math support

2024-06-21 Thread Chet Ramey
On 6/15/24 9:29 AM, Koichi Murase wrote: I still feel it would be best if POSIX could be updated to allow the implementations to extend the interpretation when the conversion by strtod(3) fails. The current restriction is not an explicit one but something deduced from the four statements of the

Re: REQUEST - bash floating point math support

2024-06-21 Thread Chet Ramey
On 6/21/24 3:59 PM, alex xmb sw ratchev wrote: > If floating point math support is added to bash, I would expect it to > be able to handle floating point literals in these forms as well. I'm not planning to do this any time soon. sorry my forgetness ... why ? Because if floati

Re: set -a leads to truncated output from ps

2024-06-21 Thread Chet Ramey
On 6/21/24 3:18 PM, alex xmb sw ratchev wrote: i see a BASH_EXCLUDE_AVAR Where do you see that? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.eduhttp://tiswww.cwru.edu/~chet/

Re: REQUEST - bash floating point math support

2024-06-21 Thread Saint Michael
Anybody else with the knowledge to tackle this? I am not capable of even writing C code correctly. On Fri, Jun 21, 2024 at 4:22 PM Chet Ramey wrote: > > On 6/21/24 3:59 PM, alex xmb sw ratchev wrote: > > > > If floating point math support is added to bash, I would expect it to > > > be

Re: REQUEST - bash floating point math support

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 10:21 PM Chet Ramey wrote: > On 6/21/24 3:59 PM, alex xmb sw ratchev wrote: > > > > If floating point math support is added to bash, I would expect > it to > > > be able to handle floating point literals in these forms as well. > > > > I'm not planning to do th

Re: set -a leads to truncated output from ps

2024-06-21 Thread alex xmb sw ratchev
On Fri, Jun 21, 2024, 10:23 PM Chet Ramey wrote: > On 6/21/24 3:18 PM, alex xmb sw ratchev wrote: > > > i see a BASH_EXCLUDE_AVAR > > Where do you see that? > in vague maybe-true future visions .. regarding the -a , to exclude vars from that rule , .. greets .. -- > ``The lyf so short, the cr

Re: STRTOLD_BROKEN test fails with gcc14

2024-06-21 Thread Chet Ramey
On 6/21/24 9:35 AM, a...@mail.citrus-it.net wrote: Bash Version: 5.2 Patch Level: 26 Release Status: release Description: When configuring bash with gcc-14, we end up with STRTOLD_BROKEN being set since the test program fails with: Thanks for the report. This was fixed in the devel branch la