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: Lawrence Velázquez
Subject: Re: invisible var content to echo when not quoted - why
Date: Sun, 28 Nov 2021 12:12:40 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-1371-g2296cc3491-fm-20211109.003-g2296cc34

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]