From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9853 invoked by alias); 7 Mar 2011 22:47:38 -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: 15843 Received: (qmail 16402 invoked from network); 7 Mar 2011 22:47:37 -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 autolearn=ham version=3.3.1 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Mon, 7 Mar 2011 17:38:16 -0500 (EST) From: "Benjamin R. Haskell" To: zzapper cc: zsh-users@zsh.org Subject: Re: globbing index* In-Reply-To: Message-ID: References: User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII 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. -- Best, Ben