Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Variable substitution Title Case
- X-seq: zsh-users 15819
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Re: Variable substitution Title Case
- Date: Wed, 23 Feb 2011 12:57:39 +0000 (UTC)
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- Organization: SuccessTheory
- References: <Xns9E95769629E82zzappergmailcom@80.91.229.10> <AANLkTikhiksgHA0vXgpq043_TmqaY4-HVciS7Qf=pQQU@mail.gmail.com>
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