help-bash
[Top][All Lists]
Advanced

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

Re: invisible var content to echo when not quoted - why


From: Alex fxmbsw7 Ratchev
Subject: Re: invisible var content to echo when not quoted - why
Date: Sun, 28 Nov 2021 18:23:33 +0100

this is on termux's bash
GNU bash, version 5.1.8(1)-release (aarch64-unknown-linux-android)

this on updated debian also

GNU bash, version 5.1.12(1)-release (aarch64-unknown-linux-gnu)



On Sun, Nov 28, 2021, 6:13 PM Lawrence Velázquez <vq@larryv.me> wrote:

> On Sun, Nov 28, 2021, at 3:52 AM, Alex fxmbsw7 Ratchev wrote:
> > declare 's=1 foo["$s"]=asd' ; declare -p s foo ; echo $s ; echo "$s" ;
> echo
> > fin
> >
> > declare -- s="1 foo[\"\$s\"]=asd"
> > bash: declare: foo: not found
> >
> > 1 foo["$s"]=asd
> > fin
> >
> >
> > notice the empty line
>
> I don't see one.
>
>     $ printf '%s\n' "$BASH_VERSION"
>     5.1.8(1)-release
>     $ unset s foo
>     $ declare 's=1 foo["$s"]=asd' ; declare -p s foo ; echo $s ; echo "$s"
> ; echo fin
>     declare -- s="1 foo[\"\$s\"]=asd"
>     bash: declare: foo: not found
>     1 foo["$s"]=asd
>     1 foo["$s"]=asd
>     fin
>
> --
> vq
>


reply via email to

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