Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: ${...%%=*} problem
- X-seq: zsh-workers 14789
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>, <zsh-workers@xxxxxxxxxx>
- Subject: Re: ${...%%=*} problem
- Date: Thu, 7 Jun 2001 14:58:36 +0000
- In-reply-to: <000301c0ef23$99be1900$21c9ca95@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <000301c0ef23$99be1900$21c9ca95@xxxxxxxxxxxxxx>
On Jun 7, 11:29am, Andrej Borsenkow wrote:
} Subject: RE: ${...%%=*} problem
}
} > > bor@itsrm2% print ${foo%%=*}
} > > zsh: * not found
} > >
} > > Why?
} >
} > Because it does expansion, include the one after an equal sign:
}
} This violates our own documentation:
You're sort of correct, but you quoted the wrong section of the doc.
The relevant bit is this, under parameter expansion:
In the expansions discussed below that require a pattern, the form of
the pattern is the same as that used for filename generation; see *Note
Filename Generation::. Note that these patterns, along with the
replacement text of any substitutions, are themselves subject to
parameter expansion, command substitution, and arithmetic expansion.
That paragraph should include "filename expansion" (but not generation)
among the list of things to which the patterns are subject. So
${foo##~}
removes the home directory from $foo.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author