bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enable compgen even when programmable completions are not available?


From: alex xmb ratchev
Subject: Re: Enable compgen even when programmable completions are not available?
Date: Mon, 26 Jun 2023 12:01:40 +0200

On Mon, Jun 26, 2023, 11:58 Kerin Millar <kfm@plushkava.net> wrote:

> On Mon, 26 Jun 2023 11:47:21 +0200
> alex xmb ratchev <fxmbsw7@gmail.com> wrote:
>
> > On Mon, Jun 26, 2023, 00:25 Eli Schwartz <eschwartz93@gmail.com> wrote:
> >
> > > compgen is a useful builtin for inspecting information about the shell
> > > context e.g. in scripts -- a good example of this is compgen -A
> function
> > > or compgen -A variable.
> > >
> > > But it's not always available depending on how bash is built, which
> > > results in people lacking confidence that it can / should be used in
> > > scripts. See e.g. https://bugs.gentoo.org/909148
> >
> >
> > i read kerin s try to parse declare -p
> >
> > for me it works ..
> >
> > bash-5.2$ { FOO=$'\nBAR BAZ QUUX='; declare -p; } |
> > while IFS=' =' read -r _ _ name _; do printf '%s\n' "$name"; done |
> > grep QUUX
> > bash-5.2$ echo $?
> > 1
> > bash-5.2$
>
> Yes. That's because you're using 5.2, which improves the quoting strategy
> for declare/typeset. Unfortunately, it's not something that I can rely upon
> in production (not least, because I can't yet assume that everyone is using
> bash >=5.2).
>

i have to say two things about that
firsly , i welcome every change of bash because its for the future , just
as the non exec thing ${ or whatever
secondly , i also code for .. production
however ppl that dont run newest versions i surely dont wanna support ,
dont support , and anti those

-- 
> Kerin Millar
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]