From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22716 invoked from network); 3 Aug 2005 06:39:02 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Aug 2005 06:39:02 -0000 Received: (qmail 53467 invoked from network); 3 Aug 2005 06:38:56 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Aug 2005 06:38:56 -0000 Received: (qmail 25655 invoked by alias); 3 Aug 2005 06:38:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21560 Received: (qmail 25646 invoked from network); 3 Aug 2005 06:38:53 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Aug 2005 06:38:53 -0000 Received: (qmail 53169 invoked from network); 3 Aug 2005 06:38:53 -0000 Received: from 209-128-98-052.bayarea.net (HELO Yost.com) (209.128.98.52) by a.mx.sunsite.dk with SMTP; 3 Aug 2005 06:38:47 -0000 Received: from [192.168.1.2] (209-128-98-052.bayarea.net [209.128.98.52]) by Yost.com (Postfix) with ESMTP id D7642533578 for ; Tue, 2 Aug 2005 23:38:44 -0700 (PDT) Mime-Version: 1.0 Message-Id: Date: Tue, 2 Aug 2005 23:38:39 -0700 To: zsh-workers@sunsite.dk From: Dave Yost Subject: executing foo.c Content-Type: multipart/alternative; boundary="============_-1089071371==_ma============" X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,HTML_40_50, HTML_FONT_BIG,HTML_MESSAGE autolearn=no version=3.0.4 --============_-1089071371==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Hi. There should be a way in shells to say what happens if I try to run an executable file that has a filename extension belonging to some set. For example, a builtin variable like this: EXEC_SPECIAL=(/usr/local/bin/cg .c .java .cp) What this would mean is that if foo.c is executable and someone tries to execute it, do this: /usr/local/bin/cg foo.c Similarly for foo.java and foo.cp, or more if there are more extensions in the array. See http://Yost.com/computers/compileAndGo The above note about shells is at the end of the page. Comments? Dave --============_-1089071371==_ma============ Content-Type: text/html; charset="us-ascii" executing foo.c
Hi.

There should be a way in shells to say what happens if I try to run an executable file that has a filename extension belonging to some set.  For example, a builtin variable like this:

EXEC_SPECIAL=(/usr/local/bin/cg .c .java .cp)

What this would mean is that if foo.c is executable and someone tries to execute it, do this:
  /usr/local/bin/cg foo.c
Similarly for foo.java and foo.cp, or more if there are more extensions in the array.

See http://Yost.com/computers/compileAndGo

The above note about shells is at the end of the page.

Comments?

Dave
--============_-1089071371==_ma============-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6870 invoked from network); 3 Aug 2005 07:33:58 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 Aug 2005 07:33:58 -0000 Received: (qmail 92725 invoked from network); 3 Aug 2005 07:33:52 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 Aug 2005 07:33:52 -0000 Received: (qmail 5052 invoked by alias); 3 Aug 2005 07:33:48 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 21561 Received: (qmail 5040 invoked from network); 3 Aug 2005 07:33:47 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 Aug 2005 07:33:47 -0000 Received: (qmail 92383 invoked from network); 3 Aug 2005 07:33:47 -0000 Received: from mail-ihug.icp-qv1-irony1.iinet.net.au (203.59.1.195) by a.mx.sunsite.dk with SMTP; 3 Aug 2005 07:33:41 -0000 Received: from 203-214-130-184.dyn.iinet.net.au (HELO localhost.localdomain) (203.214.130.184) by mail-ihug.icp-qv1-irony1.iinet.net.au with ESMTP; 03 Aug 2005 15:33:35 +0800 X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAA== X-IronPort-AV: i="3.95,162,1120406400"; d="scan'208"; a="35957490:sNHT15502156" Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.13.4/8.12.8) with ESMTP id j737QRt9032109 for ; Wed, 3 Aug 2005 17:26:28 +1000 Received: (from doug@localhost) by localhost.localdomain (8.13.4/8.13.4/Submit) id j737QO32032108 for zsh-workers@sunsite.dk; Wed, 3 Aug 2005 17:26:24 +1000 X-Authentication-Warning: localhost.localdomain: doug set sender to dougkearns@gmail.com using -f Date: Wed, 3 Aug 2005 17:26:24 +1000 From: Doug Kearns To: zsh-workers@sunsite.dk Subject: Re: executing foo.c Message-ID: <20050803072624.GE28161@localhost.localdomain> Mail-Followup-To: zsh-workers@sunsite.dk References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.0.4 On Tue, Aug 02, 2005 at 11:38:39PM -0700, Dave Yost wrote: > Hi. > > There should be a way in shells to say what happens if I try to run > an executable file that has a filename extension belonging to some > set. For example, a builtin variable like this: > > EXEC_SPECIAL=(/usr/local/bin/cg .c .java .cp) > > What this would mean is that if foo.c is executable and someone tries > to execute it, do this: > /usr/local/bin/cg foo.c > Similarly for foo.java and foo.cp, or more if there are more > extensions in the array. > > See http://Yost.com/computers/compileAndGo > > The above note about shells is at the end of the page. > > Comments? I haven't had a look at the above page yet but would a suffix alias be sufficient? % alias -s c=/usr/local/bin/cg % hello.c Regards, Doug