Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: executing foo.c
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author