From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11625 invoked from network); 7 Jul 2005 14:51:19 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 7 Jul 2005 14:51:19 -0000 Received: (qmail 10483 invoked from network); 7 Jul 2005 14:51:12 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 7 Jul 2005 14:51:12 -0000 Received: (qmail 4021 invoked by alias); 7 Jul 2005 14:51:05 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9050 Received: (qmail 4011 invoked from network); 7 Jul 2005 14:51:04 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 7 Jul 2005 14:51:04 -0000 Received: (qmail 9497 invoked from network); 7 Jul 2005 14:51:04 -0000 Received: from vanunu.ucsc.edu (128.114.141.22) by a.mx.sunsite.dk with SMTP; 7 Jul 2005 14:51:00 -0000 Received: from localhost (localhost [127.0.0.1]) by vanunu.ucsc.edu (Postfix) with ESMTP id 67FB662CBE9; Thu, 7 Jul 2005 07:51:24 -0700 (PDT) Date: Thu, 7 Jul 2005 07:51:24 -0700 (PDT) From: William Scott X-X-Sender: wgscott@vanunu.ucsc.edu To: Nikolai Weibull Cc: zsh-users@sunsite.dk Subject: Re: Adding a prefix to certain filename completions In-Reply-To: <20050707105817.GA5452@puritan.pnetwork> Message-ID: References: <20050705172846.GB5362@puritan.pnetwork> <20050704193711.GF6330@puritan.pnetwork> <20050705042324.GA21301@picard.franken.de> <20050705080946.GC5333@puritan.pnetwork> <1050706050022.ZM13972@candle.brasslantern.com> <20050706113154.GA5313@puritan.pnetwork> <20050707020210.GA5084@puritan.pnetwork> <1050707054007.ZM14965@candle.brasslantern.com> <20050707105817.GA5452@puritan.pnetwork> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 Does this work? I sent it a couple of days ago but it seems not to have appeared on the list. In any case, it separates the arguments from the filenames, as well as local files from ones with relative or absolute paths prepended to them, and only issues ./++foo or the equivalent where needed. #!/bin/zsh -f # newvim inputfilearray=( "$@" ) LIMIT=$# for ((i = 1; i <= $LIMIT; i++ )) do eval file="\$$i" if [[ -f $inputfilearray[i] && $inputfilearray[i] == "$(basename $inputfilearray[i])" ]] then inputfilearray[i]="./$inputfilearray[i]" else : fi done command vim "$inputfilearray[@]"