On Feb 23, 8:41 pm, Allen Halsey <allenhal...@gmail.com> wrote:
> Eric Blake <eblake <at> redhat.com> writes:
>
>
>
> > But you missed that:
>
> > $(date +'%Y-%m-%d')
>
> > is an entire word (basically, an unquoted $ character consumes until the
> > end of the shell substitution, command substitution, or arithmetic
> > substitution, and that entire scan becomes part of the current word being
> > parsed).
>
> Thank you Eric and Chris.
>
> The link to the POSIX section on Token Recognition really helped my
> understanding.
>
> I don't think I missed anything in the Bash Reference Manual that
> explains this.
>
> Allen

>From the Bash info-file:

"The order of expansions is: brace expansion, tilde expansion,
parameter, variable, and arithmetic expansion and command substitution
(done in a left-to-right fashion), word splitting, and filename
expansion."

So command substitution is performed before word splitting.

Reply via email to