zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: dominik.vogt@gmx.de, zsh-users@zsh.org
Subject: Re: Modifiers and parameter expansion?
Date: Thu, 1 Dec 2022 17:48:54 -0800	[thread overview]
Message-ID: <CAH+w=7ZsBzLANSaQkGKepbR24CkZJ7P7xTtuk-bh0NF+onnCNQ@mail.gmail.com> (raw)
In-Reply-To: <Y4lUvObozru+/gxa@localhost>

On Thu, Dec 1, 2022 at 5:28 PM Dominik Vogt <dominik.vogt@gmx.de> wrote:
>
> > ${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.
>
> Actually that is only true for "normal" parameters.  Neither of the
> special parameters except "_" treats the following characters as
> part of the name.

The problem here is that the man page is written more colloquially
than the interpretation you're trying to put on it.  To do this
rigorously, we'd reference the grammar of an "identifier" and explain
that NAME is the maximal string of characters matching that grammar.
But that would require even more back-referencing and technical jargon
than other people already complain about.

Special parameters aren't identifiers at all, so they don't obey this
description.

> With braces, unknown modifiers are rejected,
> without braces they are used as literal text:

You've caught another place where the manual was written 30 years ago
for people who already knew how csh works.  On the list it goes for
someone with a lot of time, sigh.


      reply	other threads:[~2022-12-02  1:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 21:29 Dominik Vogt
2022-12-01 21:34 ` Eric Cook
2022-12-01 21:36   ` Bart Schaefer
2022-12-01 22:39     ` Dominik Vogt
2022-12-01 23:42       ` Bart Schaefer
2022-12-02  0:52         ` Dominik Vogt
2022-12-02  1:34           ` Bart Schaefer
2022-12-02  2:47             ` Dominik Vogt
2022-12-02 17:59               ` Bart Schaefer
2022-12-02  1:28         ` Dominik Vogt
2022-12-02  1:48           ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH+w=7ZsBzLANSaQkGKepbR24CkZJ7P7xTtuk-bh0NF+onnCNQ@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).