Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: listing all executables matching 'foo'



* On Mon, Aug 23, 1999 at 04:07:16PM +0200, Dominik Vogt wrote:
>   # ls =filename
> and hit TAB :-))

* Sweth Chandramouli (sweth@xxxxxxx) [990823 15:03]:
> yes, but that returns totally different information, especially in zsh,
> [...]
> (of course, then you have issues figuring out just what
> `alias which=/bin/which ; alias which=$(whence -a which | head -1)'
> does, but that's what makes playing with your shell fun.))

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?

Sven

-- 
Sven Guckes guckes@xxxxxxxxxxxxxxxxx            using zsh-3.0.5 [961218]
ZSH HomePage: http://www.zsh.org   | Latest version:  zsh-3.1.5 [981030]
ZSH Pages:    http://www.math.fu-berlin.de/~guckes/zsh/  Tips and tricks
ZSH Tips:     http://www.math.fu-berlin.de/~guckes/zsh/tips.html



Messages sorted by: Reverse Date, Date, Thread, Author