Robert Elz writes:
> You're assuming that the manual is a precise specification of what
> is allowed.
Um, of course. "The documentation is the contract between the user and
the implementer." If something undocumented happens to work, there is
no requirement on the implementer to maintain its fu
On Thu, Apr 8, 2021 at 2:44 AM Chet Ramey wrote:
> Indirection does not check whether or not the variable it's indirecting
> is $@/$* or ${array[@/*]}. It simply goes by the return value.
It looks like it can easily be fixed with this:
diff --git a/subst.c b/subst.c
index 4f12f22d..cc9a6803 1006
On 4/7/21 10:39 AM, konsolebox wrote:
On Wed, Apr 7, 2021 at 9:25 PM Chet Ramey wrote:
On 4/5/21 4:45 PM, konsolebox wrote:
set -u
array=()
__ref=array[@]
: "${array[@]}" # Reports nothing
This is a special case, mirroring the special case that POSIX carved out
for $@ and $* in 2009.
: "$
set sets args, and exits null
no bug there
On Wed, Apr 7, 2021, 16:40 konsolebox wrote:
> On Wed, Apr 7, 2021 at 9:25 PM Chet Ramey wrote:
> >
> > On 4/5/21 4:45 PM, konsolebox wrote:
> > > set -u
> > > array=()
> > > __ref=array[@]
> > > : "${array[@]}" # Reports nothing
> >
> > This is a spec
On Wed, Apr 7, 2021 at 9:25 PM Chet Ramey wrote:
>
> On 4/5/21 4:45 PM, konsolebox wrote:
> > set -u
> > array=()
> > __ref=array[@]
> > : "${array[@]}" # Reports nothing
>
> This is a special case, mirroring the special case that POSIX carved out
> for $@ and $* in 2009.
>
> > : "${!__ref}" # Unb
On 4/5/21 4:45 PM, konsolebox wrote:
set -u
array=()
__ref=array[@]
: "${array[@]}" # Reports nothing
This is a special case, mirroring the special case that POSIX carved out
for $@ and $* in 2009.
: "${!__ref}" # Unbound variable
But this is not. Bash looks for __ref, finds it with a value