Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Modifiers and parameter expansion?
- X-seq: zsh-users 28469
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: dominik.vogt@xxxxxx, zsh-users@xxxxxxx
- Subject: Re: Modifiers and parameter expansion?
- Date: Thu, 1 Dec 2022 15:42:27 -0800
- Archived-at: <https://zsh.org/users/28469>
- In-reply-to: <Y4ktCdAPhIVR7bGk@localhost>
- List-id: <zsh-users.zsh.org>
- References: <Y4kcyW/acG5cPz+o@localhost> <1dcdd69c-ce29-921f-f0f0-6862f68b62a6@gmx.com> <CAH+w=7amodhidc8i1MqPWkqhYv2PkN56WmZQ8e-g-GU6p3F6GA@mail.gmail.com> <Y4ktCdAPhIVR7bGk@localhost>
On Thu, Dec 1, 2022 at 2:39 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
>
> I cannot find anything in the man page that suggest it would work
> this way. All occurences of modifiers used with parameters put
> them in braces. The rule from the man page:
>
> 7. Modifiers
That rule is just telling you at what point during all possible
expansions the effects of modifiers come into play, it's unrelated to
the syntax.
In the Parameter Expansion section
${NAME}
The value, if any, of the parameter NAME is substituted. The
braces are required if the expansion is to be followed by a letter,
digit, or underscore that is not to be interpreted as part of NAME.
In addition, more complicated forms of substitution usually require
the braces to be present; exceptions, which only apply if the
option KSH_ARRAYS is not set, are a single subscript or any colon
modifiers appearing after the name, or any of the characters '^',
'=', '~', '#' or '+' appearing before the name, all of which work
with or without braces.
Note "exceptions ... are a single subscript or any colon modifiers
appearing after the name ..."
Messages sorted by:
Reverse Date,
Date,
Thread,
Author