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

Re: shebang consistency



On Wed, Dec 12, 2007 at 11:38:06PM -0500, Clint Adams wrote:
> On Wed, Dec 12, 2007 at 08:13:39PM -0800, Bart Schaefer wrote:
> > (Why doesn't s:^#!.*[^ /]zsh:#!/bin/zsh: do the trick?  How much shorter
> > do you need to get?)
> 
> Probably that out-of-place caret.  I wasn't handling the env case,
> (and I don't have env in /bin), so I was thinking it would be nice to just
> have a single string to match.

env seems to consistently be in /usr/bin. I think there are very
few exceptions to that accross unices.

To make the change only on the first line:

sed -e '1!b' -e 's:^#![[:blank:]]*[^[:blank:]]*zsh:#! /bin/zsh:'

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

I like:

#! /bin/zsh --

better meself, not that it makes a lot of difference, except to
the eye and for the double-click-copy-paste or vi's W/E motions.

-- 
Stephane



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