Re: says TRACE: pid 1562: shell_getc: bash_input.location.string = `'

2021-02-15 Thread Alex fxmbsw7 Ratchev
thanks && cc list On Mon, Feb 15, 2021, 15:04 Chet Ramey wrote: > On 2/15/21 8:57 AM, Alex fxmbsw7 Ratchev wrote: > > i had yet a couple of trace msges, this one s new > > any big meaning ? > > Nope, it's informational for me. You see it because you're running a > debug version. > > -- > ``The l

Re: Behaviour of test -v with assoc array and quote character in key

2021-02-15 Thread Chet Ramey
On 2/14/21 6:27 PM, Daniel Gröber wrote: Hi list, I've found what I belive to be a bug in how `test -v` expands the key in an associative array. The following minimal test case demonstrates the problem: declare -A array mytest () { array["$1"]=123 test

Re: export loses error

2021-02-15 Thread Chet Ramey
On 2/14/21 4:03 AM, Stephane Chazelas wrote: 2021-02-09 10:23:51 -0500, Chet Ramey: [...] It's the assignment statement that's the oddball here; it's the only place where the exit status from a command substitution has any effect. This is a POSIX (maybe ksh) invention to provide assignment state

Re: [PATCH] Fix blocking read timeouts at a small probability

2021-02-15 Thread Chet Ramey
On 2/12/21 8:20 PM, Koichi Murase wrote: I personally don't use this particularly short timeout, but this shows that the masked SIGCHLD is again another ``partial'' fix. Yesterday I actually received an email from felix that he has actually posted the same issue on the mailing list last October

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Chet Ramey
On 2/13/21 5:21 PM, Robert Elz wrote: | $ bash -c ': $(case x in x) esac)' This is a well known bash deficiency. When parsing command substitutions it (approximately) simply counts (unquoted) parentheses to find the end. Anything with a valid closing ')' but with no opening '(' confuses

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Chet Ramey
On 2/14/21 6:02 AM, Robert Elz wrote: | I guess you are using Bash for so many years, Yes, since Paul Fox created and maintained it (version 1). It allowed me to escape from csh. (It's Brian Fox.) How long ago, and do you have any old source versions lying around? I'm always trying to g

Re: Behaviour of test -v with assoc array and quote character in key

2021-02-15 Thread Daniel Gröber
Hi Greg and Chet, On Mon, Feb 15, 2021 at 08:48:15AM -0500, Greg Wooledge wrote: > Do it this way instead: > > unicorn:~$ mytest() { array[$1]=123; test -v 'array[$1]'; echo "$?"; } Ah! I didn't know test would exand that '$1' in there, cool. > Yours expands $1 first, then passes array["] as an

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Chet Ramey
On 2/13/21 3:21 PM, Oğuz wrote: $ bash -c ': $(case x in x) esac)' bash: -c: line 1: unexpected EOF while looking for matching `)' bash: -c: line 2: syntax error: unexpected end of file `case x in x) esac' is a complete case command, a syntax error is unexpected here. It is unexpected

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Lawrence Velázquez
> On Feb 15, 2021, at 10:01 AM, Chet Ramey wrote: > > The bash command substitution parser handles the majority of these > cases (heh) lol I chuckled, well done vq

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Chet Ramey
On 2/15/21 4:35 PM, Lawrence Velázquez wrote: On Feb 15, 2021, at 10:01 AM, Chet Ramey wrote: The bash command substitution parser handles the majority of these cases (heh) lol I chuckled, well done I'll be here all week. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Koichi Murase
2021年2月16日(火) 5:12 Chet Ramey : > It is unexpected, though the syntax is obscure. I'll fix it. If this is to be fixed, maybe also the following cases could be handled better (if the corresponding fixes are not too complicated). bash -c ': $(case x in esac)' bash -c ': $(case x in (x) if :; then e

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Chet Ramey
On 2/15/21 5:39 PM, Koichi Murase wrote: 2021年2月16日(火) 5:12 Chet Ramey : It is unexpected, though the syntax is obscure. I'll fix it. If this is to be fixed, maybe also the following cases could be handled better (if the corresponding fixes are not too complicated). At some point, maybe. The

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Oğuz
16 Şubat 2021 Salı tarihinde Koichi Murase yazdı: > > bash -c ': $(case x in esac)' > bash -c ': $(case x in (x) if :; then echo a; fi esac)' > bash -c ': $(case x in (x) a() { echo a; } esac)' > bash -c ': $(case x in (x) for ((i=0;i<10;i++)) { echo a; } esac)' > bash -c ': $(case x in (x) while

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Koichi Murase
2021年2月16日(火) 13:29 Oğuz : > 16 Şubat 2021 Salı tarihinde Koichi Murase yazdı: >> bash -c ': $(case x in esac)' >> bash -c ': $(case x in (x) if :; then echo a; fi esac)' >> bash -c ': $(case x in (x) a() { echo a; } esac)' >> bash -c ': $(case x in (x) for ((i=0;i<10;i++)) { echo a; } esac)' >> b

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Oğuz
On Tue, Feb 16, 2021 at 8:34 AM Koichi Murase wrote: > Because the ending keywords---}, fi, done, and esac---are allowed to > be chained, which I think is undocumented though. > > $ { { { { { echo "Something like this is allowed"; } } } } } > Huh. So a compound list consisting of a single compou

Re: syntax error while parsing a case command within `$(...)'

2021-02-15 Thread Koichi Murase
2021年2月16日(火) 13:56 Oğuz : > $ if (:) then (:) fi > $ > > I had no idea. Oh, I forgot about `(list)'. I should also add this to the list: $ bash -c ': $(case x in (x) (echo a) esac)' -- Koichi

Re: Behaviour of test -v with assoc array and quote character in key

2021-02-15 Thread Greg Wooledge
On Mon, Feb 15, 2021 at 12:27:42AM +0100, Daniel Gröber wrote: > I've found what I belive to be a bug in how `test -v` expands the key in an > associative array. The following minimal test case demonstrates the > problem: > > declare -A array > > mytest () { > array["$1"]=

says TRACE: pid 1562: shell_getc: bash_input.location.string = `'

2021-02-15 Thread Alex fxmbsw7 Ratchev
i had yet a couple of trace msges, this one s new any big meaning ?

Re: says TRACE: pid 1562: shell_getc: bash_input.location.string = `'

2021-02-15 Thread Chet Ramey
On 2/15/21 8:57 AM, Alex fxmbsw7 Ratchev wrote: i had yet a couple of trace msges, this one s new any big meaning ? Nope, it's informational for me. You see it because you're running a debug version. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, v