Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: shebang consistency

On Dec 12,  6:31pm, Clint Adams wrote:
} Could we standardize on a single line so as to shorten the regex
} in my s/// ?

Well ...

#!/bin/env zsh  does not permit the possibility of adding the -f option,
so it's out.

Any other string needs to be edited to insert the local path to the
zsh binary, so for files that really are scripts it doesn't matter
what we start with, it'll be wrong as often as right.

I presume your s/// is doing what I'd otherwise suggest, which is that
"make install" fix up the #! line(s) when copying the files into place.
At that point it should be able to determine what the correct install
path for the binary would be.

(Why doesn't s:^#!.*[^ /]zsh:#!/bin/zsh: do the trick?  How much shorter
do you need to get?)

I guess I'd suggest standardizing on "#!/bin/zsh" plus options.

} Functions/Calendar/calendar_add:#!/bin/env zsh
} Functions/Example/cat:#! /usr/local/bin/zsh -f
} Functions/Example/zless:#!/usr/bin/zsh -f
} Functions/Misc/zkbd:#! /bin/zsh -f
} Functions/Misc/zcalc:#!/usr/local/bin/zsh -i
} Functions/Misc/checkmail:#! /usr/local/bin/zsh
} Functions/Misc/run-help:#!/usr/local/bin/zsh

Most of the files in Functions/ are not intended to be run as scripts
in any case, so the only reason for the #! line is so that clever
editors like vim and emacs can activate the correct syntax mode ...

Messages sorted by: Reverse Date, Date, Thread, Author