From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13522 invoked from network); 25 Aug 1999 14:22:46 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 25 Aug 1999 14:22:46 -0000 Received: (qmail 25720 invoked by alias); 25 Aug 1999 14:22:26 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 2508 Received: (qmail 25713 invoked from network); 25 Aug 1999 14:22:26 -0000 Date: Wed, 25 Aug 1999 16:22:23 +0200 From: Hubert Canon To: zsh-users@sunsite.auc.dk Subject: Re: listing all executables matching 'foo' Message-ID: <19990825162223.A18978@youkaidi.irisa.fr> References: <19990823152219.I32224@hp.com> <19990823233551.B31064@drizzt.ihug.com.au> <19990823160716.M32224@hp.com> <19990823110321.A1724@cj952583-b.alex1.va.home.com> <19990825154631.C2803@ritz.math.fu-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.95.7us In-Reply-To: <19990825154631.C2803@ritz.math.fu-berlin.de> Sven Guckes écrivait : > Apropos: > > _listall () { > if [[ $# = 0 ]] > then > echo "Usage: $0 program" > echo "Example: $0 zsh" > echo "Lists all occurrences of program in the current PATH." > else > for program in `which -a $1` > do > ls -lL $program > done > fi > } > > Comments? Gives strange things with aliases and functions : % which -a which which: aliased to which -a which: shell built-in command /bin/which /usr/bin/which % _listall which ls: which:: No such file or directory ls: aliased: No such file or directory ls: to: No such file or directory ls: which: No such file or directory total 4 drwx------ 2 canon pampa 512 Aug 25 16:21 . drwx------ 5 canon pampa 2560 Aug 25 16:21 .. ls: which:: No such file or directory ls: shell: No such file or directory ls: built-in: No such file or directory ls: command: No such file or directory -r-xr-xr-x 1 bin bin 1155 Oct 25 1995 /bin/which -r-xr-xr-x 1 bin bin 1155 Oct 25 1995 /usr/bin/which -- Hubert Canon