From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4556 invoked by alias); 26 Oct 2010 21:43:08 -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: 15499 Received: (qmail 9925 invoked from network); 26 Oct 2010 21:42:56 -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=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 Received-SPF: none (ns1.primenet.com.au: domain at myproxylists.com does not designate permitted sender hosts) X-Originating-IP: 127.0.0.1 Message-ID: <425111e110945b68fb95a6176414d7da.squirrel@gameframe.net> In-Reply-To: <19655.16111.999209.381824@ixian.com> References: <19655.16111.999209.381824@ixian.com> Date: Wed, 27 Oct 2010 00:42:53 +0300 Subject: Re: How to capitalize last character of a string? From: nix@myproxylists.com To: zsh-users@zsh.org User-Agent: SquirrelMail/1.4.20 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal > nix, > > nix@myproxylists.com writes: > ] Subject: How to capitalize last character of a string? > ] Hi, as the subject says, any guidance? > ] > ] TEST="word" > ] > ] print "${(C)TEST[1]}$TEST[2,-1]" > ] > ] Capitalizes the first character but somehow I could not come up with > ] solution other way. > > I'm not familiar with the syntax, but inferred the following. It seems > to work: > > % TEST="word" > % print "$TEST[1,-2]${(C)TEST[-1]}" > worD > % > > Regards, > Eric > -- > Eric De Mund > ead@ixian.com > Thanks. Sorry for duplicate question (i sent earlier this same question and some other gave a solution). It works yes. I am really having trouble with these modifiers. Last question: How to apply both macros (Capitalize the first and the last letter) ? [CapitaL] So the result would be: WorD