From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25882 invoked from network); 8 Jul 2004 06:50:10 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.85) by ns1.primenet.com.au with SMTP; 8 Jul 2004 06:50:10 -0000 Received: (qmail 24692 invoked from network); 8 Jul 2004 06:50:31 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 8 Jul 2004 06:50:31 -0000 Received: (qmail 11379 invoked by alias); 8 Jul 2004 06:49:35 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7668 Received: (qmail 11369 invoked from network); 8 Jul 2004 06:49:35 -0000 Received: from odin.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.85) by sunsite.dk with SMTP; 8 Jul 2004 06:49:35 -0000 Received: (qmail 23735 invoked from network); 8 Jul 2004 06:50:04 -0000 Received: from unknown (HELO moonbase.zanshin.com) (@167.160.213.139) by a.mx.sunsite.dk with SMTP; 8 Jul 2004 06:49:50 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i686nKTU011682 for ; Wed, 7 Jul 2004 23:49:20 -0700 Date: Wed, 7 Jul 2004 23:49:19 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: why won't this function work? In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 It's generally preferable if you supply some details about the difference between what does happen and what you intend to have happen, rather than just say "doesn't work." However, some possible clues ... On Thu, 8 Jul 2004 gj@freeshell.org wrote: > (( " $# < 1 " )) && { Don't put quotes around the expression inside the double parens. All that accomplishes is to fool zsh into thinking you meant to create a subshell, so it attempts to execute a command rather than evaluate math. > cmd=("" `grep -w $1 $HISTFILE | sort | uniq | pr -tn` ""); Unless you have setopt KSH_ARRAYS, zsh numbers arrays from 1, not from 0, so the leading empty element may be throwing off your subscript later. I have no idea why the trailing empty element is there.