Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Modifiers and parameter expansion?
- X-seq: zsh-users 28468
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Modifiers and parameter expansion?
- Date: Thu, 1 Dec 2022 23:39:05 +0100
- Archived-at: <https://zsh.org/users/28468>
- In-reply-to: <CAH+w=7amodhidc8i1MqPWkqhYv2PkN56WmZQ8e-g-GU6p3F6GA@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: zsh-users@xxxxxxx
- References: <Y4kcyW/acG5cPz+o@localhost> <1dcdd69c-ce29-921f-f0f0-6862f68b62a6@gmx.com> <CAH+w=7amodhidc8i1MqPWkqhYv2PkN56WmZQ8e-g-GU6p3F6GA@mail.gmail.com>
- Reply-to: dominik.vogt@xxxxxx
- Ui-outboundreport: notjunk:1;M01:P0:aFENaLGM83w=;Q/S38qVccr4NOig/AOErbkw8Kc7 nrEn2xUhP0Kadig5jfjOpxr7WkB2nE2BCRlLh962rjYvDNfZGl+5ze7V0AZRRfXnisArEug43 0Tfev4CoBaeuUmApV8RoyLK467ryPoTw/M/q5+TK4gbO6pVETutvpXTwvQ0UWANID4p/9GdAs k014WYcYFUeL8WHUvuDJt5zN5IMEyZxcSfUXeMYf3lD12DwG2lgQlA+yh4H0jsABZNLqoM5sb kyWBZtfpkLZYX5t/C5PjDtb2C1Osun/aNUUecAtLvbwNfw+PNQiF+IQLZojOKl3V5WNtvV5jN tFdTPKgIbCeDdYwCmQ55p0cDV0o+G9W/Fe9VeBgjhnl3GwjK/cbYx/IU6JYLIuhzPQd2HLB92 UCizdpoLFMPK8Kwy6Kbv2lf/dwshVlmJDwvRxWeDqCb//eZJN2kU78stuJZRBtw68nTm98TrX qEISQYWTwQ+L3kIxo+uPCrkXX+TBft0n+N65J15yNst3RbHhgaiiAO/LPmAtz1XXIYKuK1kjC 4Zu9pyFp7kL8QMXBbpEPoG6UBXUm0tBMfIIi9V3AxhiWt1BTlaAWba97BUaZeXyUo5haAmfat ntbEKKOduuyCo2pFjskN5oSsYgBdpHAjB9QUp6sKdB0XiBidJhDbdJgfWXG2qJO4o2NtPy/Cr BfndnWkCKRf/dEX9LNbmOF8agIMVq3J3WmxjDxUNgGF1vgPYTCqUDHnVpSEuB9gt3HyBVWSlZ aIx6FzO581wBmeedj7v+cUJy3RdtWknjVIWGQQXUCAUWak6L1oPO2Ypr4s1Q1YhQQwyvQfMuu BPYeZiH/wp/DK5tbv1LPkeYlU9Rn8lo3lOdJR9Lz5SCS8F1eUu4wfuwCFsD4FlJdJgY87k1ZD B5+HNHJBy8rQ+X8oqJ3FWLykXm5+nDCvdSHnwvUVAWbjbf4fvr1r6i0ftoWIYb1Jvs+Xevu3d nLWot7UXmjMGc+TtwkMmvteF72k=
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@xxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author