From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9384 invoked by alias); 15 May 2012 19:38:18 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17084 Received: (qmail 23168 invoked from network); 15 May 2012 19:38:15 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 Received-SPF: neutral (ns1.primenet.com.au: 209.85.215.171 is neither permitted nor denied by SPF record at ntlworld.com) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-proxyuser-ip:date:from:to:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=Kj7CU4nraOEzhKSyy3/kbXHKpKp1/5lRc01NCcPwjMo=; b=fdvrGu/nOmU84hq70qOdexatNKICey94RkQ3QwN5dRVJ+4njozaVxSRsCFw7YYoop3 NMmeJmOHAKFpgfPIl+Ac4+69ysUQ6zTdmntg4O5Yob3vurwkXK6lIhjBa3TOnWWZg6Z9 BI4lI7pN/P9x/avpr+Cr0N9yIIB8tWfRGY3iRs6l/6suQNBEuHCB1q0Lpv5Urdr0/Unz Gzaftnb3/qLM1O0qirsdpI0/ZBpeWsVttH8t9tSs3db495z5+YeYAeGWemp24xRMV7yb /aq8LMBINYaWTjEqNwGtL3zOghp+9/dRckZbiC5OBp8ONJj4o6QeR+iwAXbnE4gHFMvt E6SA== X-ProxyUser-IP: 86.6.29.42 Date: Tue, 15 May 2012 20:29:59 +0100 From: Peter Stephenson To: "zsh-users@zsh.org" Subject: Re: changing case to Title Case Message-ID: <20120515202959.23d0f57b@pws-pc.ntlworld.com> In-Reply-To: <17E2103A984D4F51BF3CC1706E237D57@gmail.com> References: <17E2103A984D4F51BF3CC1706E237D57@gmail.com> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.7; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmF9kKLvgN++yWIq6o2vpsqT7xxEmOSQ5guoV+DSaxrGd9AjyvWAAS5dIy0iBQDPrGMjEBt On Mon, 14 May 2012 15:30:49 -0400 TJ Luoma wrote: > $ foo="ONE TWO thRee FoUR" > $ print -r -- "${(C)foo}" > > will output this: > > One Two Three Four > > but this: > > $ foo="ONE TWO thRee FoUR's" > $ print -r -- "${(C)foo}" > > > > will give this: > > One Two Three Four'S > > Note the S is capitalized If you like squiggles, you could do this: print -r -- ${${(L)foo}//(#b)((#s)|[[:space:]])([[:alpha:]])/$match[1]${(U)match[2]}} -- Peter Stephenson Web page now at http://homepage.ntlworld.com/p.w.stephenson/