[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: env (GNU coreutils) 5.93 patch
From: |
Bob Proulx |
Subject: |
Re: env (GNU coreutils) 5.93 patch |
Date: |
Tue, 3 Jan 2006 09:17:56 -0700 |
User-agent: |
Mutt/1.5.9i |
Shigeru Makino wrote:
> But I feel the charm to write follows;
> #! /usr/bin/env awk -f
> rather then
> #! /usr/local/bin/awk -f or #! /usr/bin/awk -f
There is charm in working within the limitations of the system too.
> The specification against POSIX requirements.
> If I crick doing "env" hacking, are you able to create a new command?
> For instance, the command named "exe" separates the argument of each
> space interpreting #! line.
> It is possible to write as follows:
> #! /bin/exe awk -f
Personally I don't think that is the right way to go. The benefit
from using '#!/usr/bin/env command' is to get a standard launcher that
does not need to be modified for each system. Converting to a new
command there goes against the spirit of that because now the custom
launcher will be in different locations. Some people will only be
able to install it in their $HOME directory for example. Instead of
making things easier this would actually make things harder.
At that point it is actually easier to custom process the #! at
installation time and to put in the actual path to awk. (Although I
don't like doing that either.)
If you really want to find awk on path then I think the best thing is
to create a '#!/bin/sh' script to call awk on the awk program file.
#!/bin/sh
awk -f program.awk ${1+"$@"}
And then place your awk program in the separate file. That should be
maximally portable to even quite old systems.
Bob