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

Re: Variable substitution Title Case



Mikael Magnusson wrote in news:AANLkTikhiksgHA0vXgpq043_TmqaY4-
HVciS7Qf=pQQU@xxxxxxxxxxxxxx:

>  url='www.some.com/some_string_here'
> 
> echo ${${(C)url//_/ }:t}

and the final script

url='www.some.com/some_string-here'
anchortext=${${(C)url//[_-]/ }:t}
href="<a href='$url'>$anchortext</a>"

-- 
zzapper
http://zzapper.co.uk/ Technical Tips



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