From: Dominik Vogt <dominik.vogt@gmx.de>
To: zsh-users@zsh.org
Subject: Re: Modifiers and parameter expansion?
Date: Thu, 1 Dec 2022 23:39:05 +0100 [thread overview]
Message-ID: <Y4ktCdAPhIVR7bGk@localhost> (raw)
In-Reply-To: <CAH+w=7amodhidc8i1MqPWkqhYv2PkN56WmZQ8e-g-GU6p3F6GA@mail.gmail.com>
On Thu, Dec 01, 2022 at 01:36:53PM -0800, Bart Schaefer wrote:
> On Thu, Dec 1, 2022 at 1:34 PM Eric Cook <llua@gmx.com> wrote:
> >
> > On 12/1/22 16:29, Dominik Vogt wrote:
> > > Isn't this supposed to happen only if the parameter and modifier
> > > are put in braces?
>
> More specifically, Dominik is thinking in bash, whereas zsh is copying
> implementation from csh.
Actually I've never used anything but zsh unless forced to and
never tried to understand any other shell.
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
Any modifiers, as specified by a trailing `#', `%', `/' (possi-
bly doubled) or by a set of modifiers of the form `:...' (see
the section `Modifiers' in the section `History Expansion'), are
applied to the words of the value at this level.
If this rule applies to "$X:...", what is "$X%..." supposed to do?
$ X=abc
$ echo "$X:u" "$X%c" "${X%c}"
ABC abc%c ab
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
next prev parent reply other threads:[~2022-12-01 22:40 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 [this message]
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
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=Y4ktCdAPhIVR7bGk@localhost \
--to=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).