Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: suffix alias
- X-seq: zsh-users 8199
- From: Thorsten Kampe <thorsten@xxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: suffix alias
- Date: Thu, 11 Nov 2004 16:13:00 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <1bvxo3gxze39v$.dlg@xxxxxxxxxxxxxxxx> <10999.1100184634@xxxxxxx>
- Sender: news <news@xxxxxxxxxxxxx>
* 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