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.
--
``
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)
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
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
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
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