From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28271 invoked by alias); 26 Oct 2010 13:13:49 -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: 15490 Received: (qmail 17886 invoked from network); 26 Oct 2010 13:13:48 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, T_TO_NO_BRKTS_FREEMAIL autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.210.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=6yAMku4zqk6pb4rug0g2k0u/iFOjfWf0BZvQjTVYc+o=; b=N0yPIEAkJwAPGkJ7nzQuDR5vfn8yIhq0wq8l05HO23Z/hdc8h11aEdwPhCcQoONmWs j6Gmg+2p0GFbU7+X0KH9Xq01GTYumRkPhU5oId3DiS5yE04KiaSKskyLYFKIfodqQZmw OIAxy4zaQjDXOZniXsrOoERGLJ4DBhRgo0FO8= 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 :content-type:content-transfer-encoding; b=Fa74qbfO95vbQ2PCnhJL1aLoFM4SQYRCvLA8sdoaUqiCH5+fd6PCqVgKZoO/RL+K5/ 6YWP/44e2Vuqv73hKo53Ln5y3ZXUSUKPA6KXUPcoMG8+zytD5JgGC8riCwzcbhtHhmgY wLTJx4lfH+4QjK2a0KenoF9MAhuxcRZZQc5l0= MIME-Version: 1.0 In-Reply-To: References: Date: Tue, 26 Oct 2010 15:08:21 +0200 Message-ID: Subject: Re: How to capitalize last character of a string? From: Mikael Magnusson To: zsh-users@zsh.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 26 October 2010 13:56, Andr=C3=A1s Nemes wrote: > nearly there. > > print "$TEST[1,-2]${(C)TEST[-1]}" > > On Tue, Oct 26, 2010 at 10:42 PM, wrote: >> Hi, as the subject says, any guidance? >> >> TEST=3D"word" >> >> print "${(C)TEST[1]}$TEST[2,-1]" >> >> Capitalizes the first character but somehow I could not come up with >> solution other way. And if for some reason you want to capitalize the last letter of every word in a sentence (really, when don't you want to do that?), % TEST=3D"this is a sentence" % echo ${(j::)${(@Oa)${(s::)${(Cj::)${(@Oa)${(s::)TEST}}}}}} thiS iS A sentencE --=20 Mikael Magnusson