From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 840 invoked by alias); 23 Dec 2011 00:12:26 -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: 16663 Received: (qmail 23193 invoked from network); 23 Dec 2011 00:12:24 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <111222161159.ZM15011@torch.brasslantern.com> Date: Thu, 22 Dec 2011 16:11:59 -0800 In-reply-to: <4EF3C07B.4040604@eastlink.ca> Comments: In reply to Ray Andrews "'$1' indexing." (Dec 22, 3:42pm) References: <20111218101116.GA4446@miek.nl> <20111222230108.GA32237@miek.nl> <4EF3C07B.4040604@eastlink.ca> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Ray Andrews , zsh-users@zsh.org Subject: Re: '$1' indexing. MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Hmm, you posted exactly this same thing with the subject "bug" on the 20th. Did you not see the replies? Yes, it's a bug, and a patch for it has also been posted. See http://www.zsh.org/mla/workers/2011/msg01456.html for explanation and http://www.zsh.org/mla/workers/2011/msg01459.html for patch. On Dec 22, 3:42pm, Ray Andrews wrote: } Subject: '$1' indexing. } } Hi! } } First post. I thought I'd try zsh given how well spoken about it is. My } first exercise has been to try to convert my bash functions to zsh, and } it has not gone smoothly, but most problems have proved to be solvable. } But what do you guys think of this: } } function z } { } var=$1 } echo "var:/${1:0:1}/${1:1:1}/${1:2:1}/" } echo "var:/${var:0:1}/${var:1:1}/${var:2:1}/" } } } } } $ z abcde } } var: /a/a/b/ } var: /a/b/c/ } } Surely the indexing of '$1' is wrong? I can assign the value to 'var' } and all is well but I don't think I should have to. } } Thoughts? }-- End of excerpt from Ray Andrews