Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Parameter expansion flag (%) priority.
- X-seq: zsh-users 11784
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: zsh users <zsh-users@xxxxxxxxxx>
- Subject: Re: Parameter expansion flag (%) priority.
- Date: Mon, 20 Aug 2007 17:36:22 +0200
- In-reply-to: <200708201523.l7KFNxKf025619@xxxxxxxxxxxxxx>
- Mail-followup-to: zsh users <zsh-users@xxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20070820151308.GW25247@xxxxxxxxxxxxxxx> <200708201523.l7KFNxKf025619@xxxxxxxxxxxxxx>
Peter Stephenson <pws@xxxxxxx>:
> Frank Terbeck wrote:
[...]
> > The 'letters in the result' led me to the assumption, that (U) would
> > be applied *after* prompt expansion is done be (%).
> > (Same applies to (L).)
>
> Unfortunately parameter expansion does a zillion different things,
> defined by the order they happen to occur in the code, so the description
> "the result" is never going to be very helpful. Some order dependence
> is documented and this probably ought to be.
I'm not exactly familiar with zsh's parameter expansion code, but I
can believe, that it's not the most trivial piece of code ever. :-)
> > (Background is, that someone on IRC asked for a way to lowercase the
> > '%m' replace in the his PS1. Our proposal of %{(%L):-%n} turned out
> > to be broken.)
>
> That's actually easy: ${(L):-${(%):-%n}} (or %m if that's what you
> meant). This is fully guaranteed against programmers' whims.
Shouldn't ${(L)${(%):-%m} (yes, you're right, I meant '%m') be enough?
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author