Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread Chet Ramey
On 1/4/23 12:21 PM, Steffen Nurpmeso wrote: Chet Ramey wrote in <8a61e01d-65c0-6c91-3575-399022fcb...@case.edu>: |On 12/30/22 3:44 PM, Steffen Nurpmeso wrote: | |> Digital, logical, liberal, yuck :) | |We channeling Supertramp here? For a nice Breakfast in America, yes. (Not really

Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread Steffen Nurpmeso
Chet Ramey wrote in <8a61e01d-65c0-6c91-3575-399022fcb...@case.edu>: |On 12/30/22 3:44 PM, Steffen Nurpmeso wrote: | |> Digital, logical, liberal, yuck :) | |We channeling Supertramp here? For a nice Breakfast in America, yes. (Not really that. But really.) Ciao, --steffen | |Der

unset does not remove functions like a[b] unless -f is specified

2023-01-04 Thread Emanuele Torre
The unset builtin, when invoked without an option, should first try to unset the variable (or array element) specified by its arguments, and then fall back to trying to remove the function definition for the function that has the name specified by the argument if it exists. bash-5.1$ declare

Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread Chet Ramey
On 1/4/23 10:36 AM, G. Branden Robinson wrote: ..and some spend their years watching the moon bear wank himself off. Or, if you were in Yorkshire last week, a walrus. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet

Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread G. Branden Robinson
At 2023-01-04T10:22:15-0500, Chet Ramey wrote: > On 12/30/22 3:44 PM, Steffen Nurpmeso wrote: > > > Digital, logical, liberal, yuck :) > > We channeling Supertramp here? 藍 Some listen to the birds in the trees singing so happily... ..and some spend their years watching the moon bear wank

Re: Errors are ignored with local variable assignment

2023-01-04 Thread Chet Ramey
On 1/4/23 1:21 AM, Carlos Prieto López wrote: Bash Version: 5.1 Patch Level: 4 Release Status: release Description:     Errors are ignored when a command with error is assigned to a local variable on the same line of declaration. This comes up often; just last month, in fact:

Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread Chet Ramey
On 12/30/22 4:23 AM, Robert Elz wrote: For what it is worth, I tested a bunch of shells with the original expressions, all ksh variants, bosh, and bash evaluate the original expressions the bash way, all ash variants, plus yash and zsh implement it the dash way. Neither is incorrect. It

Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread Chet Ramey
On 12/30/22 3:44 PM, Steffen Nurpmeso wrote: Digital, logical, liberal, yuck :) We channeling Supertramp here? -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRUc...@case.edu

Re: Arithmetic expression: evaluation order bug

2023-01-04 Thread Chet Ramey
On 12/29/22 12:23 PM, Steffen Nurpmeso wrote: Hello. Name: bash Path: /usr/ports/core Version: 5.2.15 Release: 1 > $ i=10 j=20;echo $(( i += j += i += j ));echo $i,$j 60 60,50 This has already been beaten pretty much to death, so I'll just

Re: Errors are ignored with local variable assignment

2023-01-04 Thread Greg Wooledge
On Wed, Jan 04, 2023 at 12:21:27AM -0600, Carlos Prieto López wrote: > Description: > Errors are ignored when a command with error is assigned to a local > variable on the same line of declaration. > > f(){ > return 1 > } > > g(){ > local v=`f` > } > g && echo g > the output is 'g',

Errors are ignored with local variable assignment

2023-01-04 Thread Carlos Prieto López
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wall uname output: Linux pingu 5.10.0-20-amd64 #1 SMP Debian 5.10.158-2 (2022-12-13) x86_64