From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29504 invoked by alias); 14 Sep 2011 16:23:50 -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: 16349 Received: (qmail 23710 invoked from network); 14 Sep 2011 16:23:49 -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.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.google.com designates 209.85.212.41 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=2hVAhsNmx+uZSTHD7XReNyH+RtafJXuRlKTT9xzNzKs=; b=PEz+ERfQP7SoRuPk5lfbqYrdW/1sirg3ACEICPK97pn+3h57Jm0otPn7ZQHyhUhlI2 SP+FWQZMoJjBWvLTGlaR2TUk0DOrzyxdqGyDidTQeLF2W4aomEqPwlk1juEuI4Ji6FSe bS3VyCf3qLXHk/w414hdFUr6lB1wyYtSsLGio= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 14 Sep 2011 18:18:41 +0200 Message-ID: Subject: Re: line noise of the day From: Mikael Magnusson To: Zsh Users Content-Type: text/plain; charset=UTF-8 On 14 September 2011 17:56, Mikael Magnusson wrote: > anyone know a script/oneliner to find all duplicate/shadowed > commands on $PATH? > print -l $^commands(e,'() { (( $# > 1 )) && REPLY=$@ } > $^path/$REPLY:t(N)',N) I should have thought of this, but the above will only work in 4.3.13 and later. This should work with a few more versions (and any linebreaks are added by gmail, join them with a space). print -l $^commands(e,'a () { (( $# > 1 )) && REPLY=$@ }; a $^path/$REPLY:t(N)',N) -- Mikael Magnusson