help-bash
[Top][All Lists]
Advanced

[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: Dennis Williamson
Subject: Re: [Help-bash] Is there a syntax to declare -p address@hidden
Date: Thu, 6 Dec 2018 22:20:24 -0600

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.

>


reply via email to

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