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

Re: suffix alias



* Peter Stephenson (2004-11-11 15:50 +0100)
> Thorsten Kampe wrote:
>> I have a suffix alias "alias -s py=python". Now I can execute Python 
>> scripts by name that don't have a "she-bang" and aren't executable. 
>> That's great.
>> 
>> But now I noticed that I cannot execute Python scripts anymore that 
>> are placed in my path (/usr/bin for example) because zsh doesn't 
>> search the path anymore for the suffix alias.
>> 
>> Is there a solution for this problem?
> 
> exec-py () {
>         local -a files
>         files=(${^path}/$1(N))
>         (( ${#files} )) && set -- $files[1] "${(@)argv[2,-1]}"
>         python "$@"
> }
> alias -s py=exec-py

Thanks. So there is no "builtin" solution for this. I thought of
"command rst2html.py" which is a "kind of solution", too.

Could you explain a bit what your wrapping function does?

Thorsten



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