Re: zsh style associative array assignment bug

2021-03-31 Thread felix
Quick array assignment from command... > On Tue, Mar 30, 2021 at 12:42:46PM -0400, Eric Cook wrote: > > eval 'tags=('"${*@Q}"\) On Tue, Mar 30, 2021 at 01:16:14PM -0400, Greg Wooledge wrote: > declare -A tags=() > while IFS=\| read -r tag value; do > tags[$tag]=$value > done < <(exiftool ...)

Re: Changing the way bash expands associative array subscripts

2021-03-31 Thread Alex fxmbsw7 Ratchev
i still vote for same syntax to unset as setting it, makes only sense On Wed, Mar 31, 2021, 01:05 konsolebox wrote: > On Tue, Mar 16, 2021 at 8:12 AM Chet Ramey wrote: > > This means that, given the following script, > > > > declare -A a > > key='$(echo foo)' > > a[$key]=1 > > a['$key']=2 > > a

Re: zsh style associative array assignment bug

2021-03-31 Thread Oğuz
On Tue, Mar 30, 2021 at 7:43 PM Eric Cook wrote: > typeset -A tags=(); set -- > while IFS='|' read -ra ary; do > set -- "$@" "${ary[@]}" > done < <( > exiftool -j *.flac | > jq -r '.[]| {Artist, Track, Genre, Title}|to_entries[]| .key + "|" + > .value' > ) > eval 'tags=('"${*@Q}"\) > typese

Re: zsh style associative array assignment bug

2021-03-31 Thread Greg Wooledge
On Wed, Mar 31, 2021 at 09:40:34AM +0200, felix wrote: > As bash read loop could be something slow, I use (when I'm quiet about data > origin) something like: > > declare -A tags="($( > sed -e 's/^\([^|]*\)|\?\(.*\)/[\1]="\2"/' < <( > exiftool ...)) )" > I'm not absolutely sure

Re: zsh style associative array assignment bug

2021-03-31 Thread Eric Cook
On 3/30/21 3:44 PM, Chet Ramey wrote: Is this a serious piece of code, or just one to demonstrate a programming error? The latter There is only one field, terminated by `|', which becomes one array element. This is where you `lose' the null elements, not when you attempt to copy. Nothing you d

Re: parent trap EXIT appears to subshell but is not used

2021-03-31 Thread Robert Elz
Date:Tue, 30 Mar 2021 07:33:08 +0300 From:=?UTF-8?B?T8SfdXo=?= Message-ID: | The same goes for the job table right? Yes, though there's no posix explanation for that (no expectation there that code would ever want to examine it). | None of ash derivatives (inc