Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: whence question
On 13/01/17 08:57 PM, Ray Andrews wrote:
This seems to work and it uses my old friend 'noglob'. 'i' being my tell
me absolutely everything hyper-whence:
|$ i grub-r* ||
||
||Local file:||
||-rw-r--r-- 1 root root 0 Jan 13 20:37 grub-r||
||grub-r: empty||
||
||Local file:||
||-rw-r--r-- 1 root root 0 Jan 13 20:52 grub-rr||
||grub-rr: empty||
||
||(1)TYPE: grub-r is an alias for echo this is a phony alias:||
||
||(2)TYPE: grub-r is a shell function:||
||
||(3)TYPE: grub-reboot is /usr/sbin/grub-reboot:||
||
||(4)TYPE: grub-render-label is /usr/bin/grub-render-label:||
|
--------------------------------------
But it's a nuisance:
|alias i='noglob _i'|||
|||function _i ()|||
|||{|||
||
|...
|
|# Because I need expanded arguments for the listing of the local files:||
|
|local _args=`eval echo $@`||
||_args=( ${(z)_args} )|
|for ((i = 1; i <= ${#_args}; i++)); do||
|| if [ -e ${_args[i]} ]; then||
|| infomsg "\nLocal file:"; ls -l ${_args[i]} | grep --color=auto
-w $1||
|| file ${_args[i]} | grep --color=auto -w $1||
|| fi||
||done||
|
|...||
||# But from now on, 'whence -ma' receives the glob raw and behaves as
expected:|
|local find_count=`whence -ma "$@" | wc -l`||
|
|...||
|
|}||
|
Messages sorted by:
Reverse Date,
Date,
Thread,
Author