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

Re: alias -s doesn't friendly deal with programs having an extension



On Fri, Jun 01, 2007 at 11:29:35AM +0100, Peter Stephenson:
> 
> More generally, you could write a shell function to do this.
> 
> pathfind() {
>   local dir
>   for dir in $path; do
>     if [[ -f $dir/$2 ]]; then
>       $1 $dir/$2 "${(@)argv[3,-1]}"
>       return
>     fi
>   done
>   print pathfind: file not found in path: $2
>   return 255
> }
> alias -s pl='pathfind perl'

nice idea. could that be something for zsh-mime-setup ?



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