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: yet another $(case ... parse bug

2024-05-28 Thread Chet Ramey
On 5/24/24 1:43 AM, Oğuz wrote: While you're at it take a look at this too: true; for (( ; $? == 0; ${ ! break;} )); do uname; done The arithmetic for command should probably check for breaking after it evaluates the loop test. You have to admit this is not something people are going to write

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

2024-05-28 Thread Chet Ramey
On 5/23/24 1:19 PM, Oğuz wrote: See: $ bash -c 'for (( $(case x in x) esac);; )); do :; done' bash: -c: line 1: syntax error: `;' unexpected bash: -c: line 1: syntax error: `(( $(case x in x) ;; esac);; ))' Thanks for the report. This should be a pretty easy fix; just use extract_command

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

2024-05-23 Thread Oğuz
While you're at it take a look at this too: true; for (( ; $? == 0; ${ ! break;} )); do uname; done Once you run this command bash gets stuck in a state where it prints the prompt string and reads commands but doesn't execute anything. If you press Ctrl+C it returns to normal. Oğuz

yet another $(case ... parse bug

2024-05-23 Thread Oğuz
See: $ bash -c 'for (( $(case x in x) esac);; )); do :; done' bash: -c: line 1: syntax error: `;' unexpected bash: -c: line 1: syntax error: `(( $(case x in x) ;; esac);; ))' This is reproducible on 5.3 alpha too. Oğuz