From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21536 invoked from network); 11 Nov 2004 14:50:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 11 Nov 2004 14:50:58 -0000 Received: (qmail 79192 invoked from network); 11 Nov 2004 14:50:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 11 Nov 2004 14:50:48 -0000 Received: (qmail 812 invoked by alias); 11 Nov 2004 14:50:38 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8198 Received: (qmail 799 invoked from network); 11 Nov 2004 14:50:37 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 11 Nov 2004 14:50:37 -0000 Received: (qmail 78158 invoked from network); 11 Nov 2004 14:50:37 -0000 Received: from mailhost1.csr.com (HELO MAILSWEEPER01.csr.com) (81.105.217.43) by a.mx.sunsite.dk with SMTP; 11 Nov 2004 14:50:35 -0000 Received: from exchange03.csr.com (unverified [10.100.137.60]) by MAILSWEEPER01.csr.com (Content Technologies SMTPRS 4.3.12) with ESMTP id for ; Thu, 11 Nov 2004 14:49:26 +0000 Received: from csr.com ([10.102.144.127]) by exchange03.csr.com with Microsoft SMTPSVC(5.0.2195.6713); Thu, 11 Nov 2004 14:50:11 +0000 To: zsh-users@sunsite.dk Subject: Re: suffix alias In-reply-to: <1bvxo3gxze39v$.dlg@thorstenkampe.de> References: <1bvxo3gxze39v$.dlg@thorstenkampe.de> Date: Thu, 11 Nov 2004 14:50:34 +0000 Message-ID: <10999.1100184634@csr.com> From: Peter Stephenson X-OriginalArrivalTime: 11 Nov 2004 14:50:11.0215 (UTC) FILETIME=[BEA1E1F0:01C4C7FD] X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 Thorsten Kampe wrote: > Hi, > > 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 -- Peter Stephenson Software Engineer CSR PLC, Churchill House, Cambridge Business Park, Cowley Road Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************