From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28767 invoked by alias); 7 Mar 2011 22:55:17 -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: 15844 Received: (qmail 8650 invoked from network); 7 Mar 2011 22:55:15 -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: pass (ns1.primenet.com.au: SPF record at m.gmane.org designates 80.91.229.12 as permitted sender) X-Injected-Via-Gmane: http://gmane.org/ To: zsh-users@zsh.org From: zzapper Subject: Re: globbing index* Date: Mon, 7 Mar 2011 22:55:00 +0000 (UTC) Organization: SuccessTheory Message-ID: References: X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: dsl78-143-228-30.in-addr.fast.co.uk User-Agent: Xnews/2006.08.24 X-Antivirus: avast! (VPS 110307-0, 07/03/2011), Outbound message X-Antivirus-Status: Clean Benjamin R. Haskell wrote in news:alpine.LNX.2.01.1103071733100.2792@hp: > On Mon, 7 Mar 2011, zzapper wrote: > >> Hi >> I'm often diffing two files with a glob knowing that only 2 files match. >> say index.php and index2.php >> >> so when I type >>> diff index* >> I can assume that I will get, (but it will always be as clear) >> >>> diff index.php index2.php >> >> but is there an option to force diff to output the names of actual >> files compared? >> >> (Having posed myself the problem I've realized that I can always tab >> expand) >> >>> diff index* >> > > Personally I prefer to keep the unexpanded form for history purposes > (next time the glob might match different files). > > To output the names beforehand, you can make a function: > > diff () { echo "Diffing: $@" >&2 ; command diff "$@" } > > The 'command' precommand modifier prevents 'diff' from referring again > to the 'function' of the same name. > Yep a wrapper seems the best way. My question might appear | be trivial but the number of times I've worried which file was which! -- zzapper http://zzapper.co.uk/ Technical Tips