Re: REQUEST - bash floating point math support

2024-06-15 Thread Léa Gris
Le 15/06/2024 à 02:49, Koichi Murase écrivait : 2024年6月14日(金) 16:18 Léa Gris : Another elegant option would be to expand the existing variables' i flag to tell the variable is numeric rather than integer. Then have printf handle argument variables with the numeric flag as using the LC_NUMERIC=C

Re: REQUEST - bash floating point math support

2024-06-15 Thread Koichi Murase
2024年6月15日(土) 17:24 Léa Gris : > Indeed printf only knows the string value. But Bash know the variable > has a numeric flag when doing the value expansion, so it expands it > using the current LC_NUMERIC locale in this specific case. Ah, OK. I misunderstood your suggestion somehow differently (suc

Re: set -a leads to truncated output from ps

2024-06-15 Thread Greg Wooledge
On Sat, Jun 15, 2024 at 07:48:42AM +0300, Oğuz wrote: > Right now, if you're dealing with such a program while `set -a' is in > effect, in order to suppress COLUMNS you need to unexport it before every > command: Or just turn off checkwinsize.

Re: set -a leads to truncated output from ps

2024-06-15 Thread Koichi Murase
2024年6月15日(土) 13:48 Oğuz : > On Saturday, June 15, 2024, Koichi Murase wrote: >> Also, the behavior of the `ps' command honoring COLUMNS to format its >> output is also an expected one. > > The fact that programs giving precedence to COLUMNS over the > terminal API are so common is an argument aga

Re: set -a leads to truncated output from ps

2024-06-15 Thread Koichi Murase
2024年6月15日(土) 22:48 Koichi Murase : > 2024年6月15日(土) 13:48 Oğuz : > > On Saturday, June 15, 2024, Koichi Murase wrote: > >> Also, the behavior of the `ps' command honoring COLUMNS to format its > >> output is also an expected one. > > > > The fact that programs giving precedence to COLUMNS over the

Re: set -a leads to truncated output from ps

2024-06-15 Thread Oğuz
On Sat, Jun 15, 2024 at 4:59 PM Koichi Murase wrote: > Sorry, I think I misunderstood the part "behind the user's back". Now I > guess you were talking about the behavior of `checkwinsize' when `set > -a' is enabled? Yes. All I'm saying is, a variable that affects how certain programs behave when

Re: REQUEST - bash floating point math support

2024-06-15 Thread Léa Gris
On 15/06/2024 à 15:29, Koichi Murase wrote : at which point does the conversion happens The conversion to LC_NUMERIC format only happens during variable expansion outside of a numerical context. The numerical context can be explicit if the assigned variable has a numeric flag; it is implicit

Re: REQUEST - bash floating point math support

2024-06-15 Thread alex xmb sw ratchev
On Sat, Jun 15, 2024, 4:56 PM Léa Gris wrote: > On 15/06/2024 à 15:29, Koichi Murase wrote : > > at which point does the conversion happens > > The conversion to LC_NUMERIC format only happens during variable > expansion outside of a numerical context. > The numerical context can be explicit if t

RE: set -a leads to truncated output from ps

2024-06-15 Thread Alain BROSSARD via Bug reports for the GNU Bourne Again SHell
Hi Robert, I did think about the case to parse the output, but this means that you already know that the problem is triggered by calling an external program. Regards, Alain [cid:ISP-REYL_HubSWS_Col_email_v2_88f4ea19-df87-4cc1-aef3-c28f2127924c.png] Alain BROSSARD Syst

Re: set -a leads to truncated output from ps

2024-06-15 Thread Robert Elz
From: Alain BROSSARD | I did think about the case to parse the output, but this means that you | already know that the problem is triggered by calling an external program. I think there is some miscommunication going on here. The message I sent had nothing to do with the original problem

Question that baffles AI (all of them)

2024-06-15 Thread Saint Michael
in this code: data="'1,2,3,4','5,6,7,8'" # Define the processing function process() { echo "There are $# arguments." echo "They are: $@" local job="$1" shift local a="$1" shift local b="$1" shift local remaining="$*" echo "Arg1: '$a', Arg2: '$b'" } process "$dat

Re: Question that baffles AI (all of them)

2024-06-15 Thread Lawrence Velázquez
On Sat, Jun 15, 2024, at 5:30 PM, Saint Michael wrote: > in this code: > data="'1,2,3,4','5,6,7,8'" > > # Define the processing function > process() { > echo "There are $# arguments." > echo "They are: $@" > local job="$1" > shift > local a="$1" > shift > local b="$1" >

Re: Question that baffles AI (all of them)

2024-06-15 Thread alex xmb sw ratchev
bash dat.sh.1 1,2,3,4 a 1 , b 2 a 3 , b 4 or u meant to equally split the args ? On Sat, Jun 15, 2024, 11:30 PM Saint Michael wrote: > in this code: > data="'1,2,3,4','5,6,7,8'" > > # Define the processing function > process() { > echo "There are $# arguments." > echo "They are: $@" >

Re: Question that baffles AI (all of them)

2024-06-15 Thread Greg Wooledge
On Sat, Jun 15, 2024 at 05:30:17PM -0400, Saint Michael wrote: > in this code: > data="'1,2,3,4','5,6,7,8'" > how can I get my (a) and (b) arguments right? > The length of both strings is unpredictable. > a="1,2,3,4" and b="5,6,7,8"" This is a parsing problem. Bash is not a particularly good cho