Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Variable substitution Title Case
- X-seq: zsh-users 15816
- From: zzapper <david@xxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Variable substitution Title Case
- Date: Wed, 23 Feb 2011 11:39:30 +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
Hi
url='www.some.com/some_string_here'
want to extract and convert to' Some String Here'
anchortext=${url##*/} # echo just the trailing directory
anchortext=${anchortext//_/ } # substitute every _ with a space
anchortext=${anchortext//-/ } # substitute every - with a space
anchortext=${(L)anchortext} # lower case
been messing around with anchortext=$anchortext:gs/// but dont know if uses
regexp memory??
but how can I do titlecase?
--
zzapper
http://zzapper.co.uk/ Technical Tips
Messages sorted by:
Reverse Date,
Date,
Thread,
Author