zsh-workers
 help / color / mirror / code / Atom feed
* executing foo.c
@ 2005-08-03  6:38 Dave Yost
  2005-08-03  7:26 ` Doug Kearns
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Yost @ 2005-08-03  6:38 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1028 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: executing foo.c
  2005-08-03  6:38 executing foo.c Dave Yost
@ 2005-08-03  7:26 ` Doug Kearns
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Kearns @ 2005-08-03  7:26 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-03  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-03  6:38 executing foo.c Dave Yost
2005-08-03  7:26 ` Doug Kearns

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).