Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Modifiers and parameter expansion?
- X-seq: zsh-users 28471
- From: Dominik Vogt <dominik.vogt@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Modifiers and parameter expansion?
- Date: Fri, 2 Dec 2022 02:28:28 +0100
- Archived-at: <https://zsh.org/users/28471>
- In-reply-to: <CAH+w=7b5rQNkfQcRb1zVDbD5CMn-8F67pGS9JvshqyRiFF6nXw@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> <Y4ktCdAPhIVR7bGk@localhost> <CAH+w=7b5rQNkfQcRb1zVDbD5CMn-8F67pGS9JvshqyRiFF6nXw@mail.gmail.com>
- Reply-to: dominik.vogt@xxxxxx
- Ui-outboundreport: notjunk:1;M01:P0:a3JHEmbDPns=;RXRAzOOjLep+c5cX9zs0vscmwUW uTb3OJBlz28TSF1quiM9y03H+S3Nwz+Dy8A63lJG0cTe/sCbNDFa/YzaiC605FThZGZUTseje qr/HjskiZ/rVfLnfzCFyS1/6X6EjVlt2jL/vGULa8wQDPQBUCerjIDTpp7NmC4/F+e4187IKo e8FBKedQyaBdmvh+kXgsiAeMkEesNbHGPjD4SmBBApDqqTDrYxiKrCgi2BP0qnJGOFyYQ1tyn KUeVvLpJYr4K00jovUCas26dmGVx9dJtEjuyrEdgKYi+3aKhkSFWeHnklUv0IQsHVMOFxY++B dEmPgmIaYyUotWAbSuJ+oh7HQKnxf8J/KQG0YQCX/mJSABF6w9TRwQYcuF3WVaqKp5x4PeZJ+ 94d5EXGnR8+iCMjX6U4SX39bet3ilCXvOLk+6M7hH6UWH1hOIpVJS88UReAXOAZlQQJ82/L+r C5rKTk/loPQDgZIJ9XV9l6IwgNbdyqzvVlcTKJmkTuybNjyuEtoEyN6vjDB7IoIoQwas3vDr2 ztBkgZkquh8uMGxy+Lz7D7iqOSobQnmdxg3vbjOwXrdbCvb/YI+QVX+uHjPw2lr9g+n48K0JJ TPw0y8hnAW1CYOEXlzAFnK4HECRoWl51pjnSH6a03mBko+lJZ3m4eTgvNGZHgHobwRQENDX1a aS8OHB8DTuvgRZNgNhvDWmg0M575osiucvvJ566QwOrO5WrtcaQxXjN8Tqq/rEWwYO+ATyOZw y+l6nI2fwsT+j8YrKpJBIJk5bDe+SRvJXTzVfbs5me6zYRZlVDo5Y1QScUSD/euQx5K14pQuk TqP67f8sJj87UhAPm5GfqAsBfI6JFRP5ZktY5uiHftXsVmP0NZUBnHluvAL/ZrgHF0SiIW0e+ AweGBGnKzxXvbz2+8w892LEXKdHzM63r++SaUFYrVnaal8LYUcz2QHELsVNrc4Dgf8QJ4+afQ FDHYtw==
More inaccuracies in the man page:
On Thu, Dec 01, 2022 at 03:42:27PM -0800, Bart Schaefer 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.
$ A=abc
$ echo $?A $@A $*A $-A $$A $!A $#A
0A A A 0569EKNXZghikmsA 5775A 0A 3
> 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
This is fishy. With braces, unknown modifiers are rejected,
without braces they are used as literal text:
$ unsetopt KSH_ARRAYS
$ X=abc; echo $X:Z
abc:Z
$ echo ${X:Z}
zsh: unrecognized modifier `Z'
Should at least be documented.
Ciao
Dominik ^_^ ^_^
--
Dominik Vogt
Messages sorted by:
Reverse Date,
Date,
Thread,
Author