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

Re: foo.bar(:r) doesn't work



Steve Talley wrote:
>In zsh-3.1.2, "echo foo.bar(:r)" prints out "foo", whether foo.bar
>exists or not.  In 3.1.2-zefram4, I get the error "zsh: no match" when
>foo.bar doesn't exist.

This form was always documented as working only on the names of existing
files.  In prior versions there was special-case code to allow modifiers
to be applied to any string without performing globbing, but in the
glob changes for 3.1.2-zefram4 I simplified things a bit by making this
actually invoke globbing.  A side effect is that things like "foo(M)"
now work as expected.

You can get the effect you want -- applying modifiers to an arbitrary
string -- via parameter expansion: "echo ${${:-foo.bar}:r}" has always
been the correct way to do this.

-zefram



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