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

Parameter expansion flag (%) priority.



[snip]
zsh% print ${(%):-%n}  
hawk
zsh% print ${(U%):-%n} 
zsh
zsh% print ${(%):-%N} 
zsh
[snap]

However, the docs say:

[snip]
    U      Convert all letters in the result to upper case.
[snap]

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).)

Am I misunderstanding the docs (no native English speaker here), or am
I overlooking something? If not, should the docs be clarified?

(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.)

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