Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Title Case a Textified String
- X-seq: zsh-users 14914
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zzapper <david@xxxxxxxxxx>
- Subject: Re: Title Case a Textified String
- Date: Thu, 11 Mar 2010 14:10:15 +0100
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=cRHd7GRIOL3bRYDTFDwACG5apDScaltV/4evtPSDMww=; b=BmzPYhTeEqRlcEKcUpGMlm/PcywlLhXcT7XdebhKFwvaeRu3bM99omjPQ2q2AHTEkx RIJpYFvSW4brpl7MxopsHttEOEB9Yh7vQtR0xyWL/eDRrj0AMYlmUFm1p58hrBHE8rHx hdiN8lXvKWG7HJzW3GWw1EomzU3RgIXNXkSJ8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=JfyvIG4wRwH7uMVxRUcuObiYcvg5W8nTrF38nS3uU+wMA305mlKo4CdQIG1vXRbxg+ ehKMcUh3kwM7FsomSXrQIIntlc9WuGnOHCJ1Ohhp71OqkU8y9gjxzn9J08MMBEDJgpi+ pEEU7O9rBDHqFnoYM7Ap8JmOHf3CkLbI6GcbY=
- In-reply-to: <Xns9D38815866DD0zzappergmailcom@xxxxxxxxxxxx>
- 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
- References: <Xns9D38815866DD0zzappergmailcom@xxxxxxxxxxxx>
On 11 March 2010 13:43, zzapper <david@xxxxxxxxxx> wrote:
> Hi
> I want to convert a textified string to a Title Case Phrase
>
> eg
> fred-goat-dog.jpg to Fred Goat Dog
>
> My first timid effort
>
> echo "fred-goat-dog.jpg" | sed 's/-/ /g' | sed 's/\.jpg//'
>
>
> Perl would do this with ease but is there a zsh solution (of course there
> is!)
foo=fred-goat-dog.jpg
echo ${(C)foo:gs/-/ /:r}
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author