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

Re: listing all executables by prefix - solution!



* Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> [2002-04-15 17:56]:
> ls -l ${(@)$(hash -m prefix\*)#*=}

thanks, Bart!  :-)

but there must be something about
what Peter Stephenson said in his mail,
because his version works always.  so
now I'm using "whence" in my function:

# function _lap { for i in  ${(@)$(hash -m $1\*)#*=};   do ls -l $i; done}
  function _lap { for i in "${(@f)$(whence -pm $1\*)}"; do ls -l $i; done}

zsh> _lap zsh
-rwxr-xr-x   2 guckes   emailer    456536 Oct 29 03:32 /home/sguckes/bin/zsh-4.0.4
-rwxr-xr-x   1 root     root       405212 Jun 23  1999 /import/local/bin/zsh-3.0.5
-rwxr-xr-x   3 root     other      492576 Mar 24  2001 /import/local/bin/zsh-3.0.6
-rwxr-xr-x   3 root     other      492576 Mar 24  2001 /import/local/bin/zsh-3.0.8
-rwxr-xr-x   2 guckes   emailer    456536 Oct 29 03:32 /home/sguckes/bin/zsh

cool! :-)

Sven  [trying to figure out how it all works]

-- 
"it must be wonderful - i
dont understand it at all!"  ;-)
vim: nowrap



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