[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Is there a syntax to declare -p address@hidden
From: |
Peng Yu |
Subject: |
Re: [Help-bash] Is there a syntax to declare -p address@hidden |
Date: |
Thu, 6 Dec 2018 22:23:26 -0600 |
On Thu, Dec 6, 2018 at 10:20 PM Dennis Williamson
<address@hidden> wrote:
>
>
>
> On Thu, Dec 6, 2018, 10:13 PM Peng Yu <address@hidden wrote:
>>
>> On Wed, Dec 5, 2018 at 8:40 AM Tadeus Prastowo <address@hidden> wrote:
>> >
>> > On Wed, Dec 5, 2018 at 12:31 AM Peng Yu <address@hidden> wrote:
>> >
>> > [...]
>> >
>> > > $ ./main.sh
>> > > set -- 1 '2 3'
>> > > echo ${@@A}
>> > > set -- '1' '2 3'
>> > > echo "${@@A}"
>> > > set -- '1' '2 3'
>> > >
>> > >
>> > > Where is it documented?
>> >
>> > https://www.gnu.org/software/bash/manual/bashref.html#Shell-Parameter-Expansion,
>> > particularly as quoted below:
>> >
>> > address@hidden
>> > The expansion is either a transformation of the value of parameter
>> > or information about parameter itself, depending on the value of
>> > operator. Each operator is a single letter:
>> > [...]
>> > A
>> > The expansion is a string in the form of an assignment statement
>> > or declare command that, if evaluated, will recreate parameter with
>> > its attributes and value.
>> > [...]
>> > If parameter is address@hidden or ‘*’, the operation is applied to each
>> > positional parameter in turn, and the expansion is the resultant list.
>> > [...]
>> > The result of the expansion is subject to word splitting and
>> > pathname expansion as described below.
>>
>> How to understand why `echo address@hidden only print an empty line?
>>
>> $ echo "address@hidden"
>>
>> $ echo "${$}"
>> 613
>> $ echo address@hidden
>>
>> $ echo address@hidden
>> declare -ir BASHPID='440'
>>
>> --
>> Regards,
>> Peng
>
>
> You have too many dollar signs and not enough at signs. Try ${@@A} as Tadeus
> posted.
No. I am referring to a different variable $$ insead of address@hidden
--
Regards,
Peng
- [Help-bash] Is there a syntax to declare -p address@hidden, Peng Yu, 2018/12/04
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Grisha Levit, 2018/12/04
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Peng Yu, 2018/12/04
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Tadeus Prastowo, 2018/12/05
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Peng Yu, 2018/12/05
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Peng Yu, 2018/12/06
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Dennis Williamson, 2018/12/06
- Re: [Help-bash] Is there a syntax to declare -p address@hidden,
Peng Yu <=
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Dennis Williamson, 2018/12/06
- Re: [Help-bash] Is there a syntax to declare -p address@hidden, Chet Ramey, 2018/12/07
Re: [Help-bash] Is there a syntax to declare -p address@hidden, Chris F.A. Johnson, 2018/12/04