bug-bash
[Top][All Lists]
Advanced

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

Re: Confused about how bash breaks input into words


From: DennisW
Subject: Re: Confused about how bash breaks input into words
Date: Tue, 23 Feb 2010 22:35:00 -0800 (PST)
User-agent: G2/1.0

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

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