Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Modifiers and parameter expansion?

On Thu, Dec 1, 2022 at 4:52 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
> > >        7. Modifiers
> Okay.  Why are "%" "%%" "#" "##" "/" "//" refered to in this
> section?

Because they happen to be interpreted at the same "step" as modifiers,
and the documentation grew organically?

> > In the Parameter Expansion section
> >
> > ${NAME}
> The braces are required unless(1) they are not(2) required
> unless(3) some option is not(4) present.  Quadruple negative.

Not sure where you came up with that.  The braces are required when
(A) or when (B) or when (C), except (D) when not (C).
(A) followed by something may be part of an identifier
(B) complicated forms
(D) colons after or other tokens before

> All I understand is that it's trial and error to figure out
> whether braces are required.


>   $ unsetopt KSH_ARRAYS
>   $ echo ^a =ls
>   $ echo ~a

No, that's completely irrelevant.  The BRACES aren't required, but the
$ IS.  The above is not parameter expansion.


KSH_ARRAYS requires

> This section could be split in two, to improve readability:

Possibly, but that affects several of the following descriptions as well.

Messages sorted by: Reverse Date, Date, Thread, Author