Re: [PATCH] compgen -V option (store output in array)

2023-04-17 Thread Koichi Murase
2023年4月18日(火) 0:59 Chet Ramey : > Once you have -V, isn't -z superfluous? It's just > > compgen -V varname options word > printf '%s\0' "${varname[@]}" > > right? What am I missing? You are right. Actually, when I implemented -z, I also initially thought about the possibility to add an option to s

Re: 'mapfile -O1 array' breaks '[[ -v array ]]'

2023-04-17 Thread Chet Ramey
On 4/17/23 1:23 PM, Wiley Young wrote: Bash Version: 5.1 Patch Level: 16 Release Status: release Description: When an array 'a_foo' is created with 'mapfile -d '' -t', it is tested with '[[ -v a_foo ]]' and '[[' returns 0. When '-O 1' is added to mapfile, '[[ -v a_foo ]]' returns non-0

Re: 'mapfile -O1 array' breaks '[[ -v array ]]'

2023-04-17 Thread Greg Wooledge
On Mon, Apr 17, 2023 at 10:23:17AM -0700, Wiley Young wrote: > Description: > When an array 'a_foo' is created with 'mapfile -d '' -t', it is > tested with '[[ -v a_foo ]]' and '[[' returns 0. When '-O 1' is added to > mapfile, '[[ -v a_foo ]]' returns non-0. It's not specifically the -O1

'mapfile -O1 array' breaks '[[ -v array ]]'

2023-04-17 Thread Wiley Young
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-g> uname output: Linux localhost-live 6.0.7-301.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC> Machine Type: x86_64-redh

Re: [PATCH] compgen -V option (store output in array)

2023-04-17 Thread Chet Ramey
On 4/13/23 4:57 AM, Koichi Murase wrote: 2023年4月13日(木) 17:31 Grisha Levit : Since the predominant use case for compgen is generating output that then gets split back up into an array, it seems like it would be nice to have an option that avoids the extra steps (and their associated pitfalls)

Re: [PATCH] compgen -V option (store output in array)

2023-04-17 Thread Chet Ramey
On 4/13/23 4:30 AM, Grisha Levit wrote: Since the predominant use case for compgen is generating output that then gets split back up into an array, it seems like it would be nice to have an option that avoids the extra steps (and their associated pitfalls) Thanks, this looks reasonable. -- ``