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

Re: /usr/local/bin/perl



Dragging up an old topic ...

Oliver Kiddle (okiddle@xxxxxxxxxxx) wrote:
> --- Adam Spiers <adam@xxxxxxxxxx> wrote:
> > The following scripts hardcode binary locations (excluding /bin/sh
> 
> > Can we avoid this?  Is env(1) common to enough platforms, for
> > instance, or maybe we could add something to configure?
> 
> I'd agree that this is something which would be nice to clean up. I'd
> have thought that it would be fine to use env for these.

I'm not so sure env is any use now, as it appears to break if you
specify any switch, e.g.

  #!/usr/bin/env perl -w

breaks with

  env: perl -w: No such file or directory

Pretty remarkably braindead IMHO, but there we go.

> Setting the #! lines would be quite simple from configure but I'm not
> sure it is worth it for the extra complexity and potential for things
> to break.

Bart Schaefer (schaefer@xxxxxxxxxxxxxxxxxxxxxxx) wrote:
> The only reason that I've added #! lines anywhere is so that emacs will
> start up in shell script mode and select the correct syntax.
> 
> }    Util/helpfiles           :   #!/usr/bin/perl -- -*-perl-*-
> 
> The -*- perl -*- is extraneous there, at least in newer versions of emacs.
> It'll figure it out from the tail of the #! path.

Yep.

> }    Test/ztst.zsh            :   #!/usr/local/bin/zsh -f
> 
> That should be ".../zsh -f +Z".

Indeed, and I believe that I've had tests misleadingly fail through
running `make test' before `make install' as a result of that.  Shall
I change it then?

> If you put env in the #! line -- or put the #! line anywhere but as the
> first line in the script -- it foils emacs' algorithm for figuring out
> which mode to start in.  Same issue if you put some kind of @...@ thing
> for configure there.  Not that this should be the primary reason for any
> decision that we make, but at least consider it.

We can persuade emacs to use the right mode using the other method:

  # Local Variables:
  # mode:cperl
  # End:

should do it.

If we use configure, presumably that would mean having (say)
Utils/helpfiles auto-generated from Utils/helpfiles.in?  My vote is
for that option.



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