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

Re: zsh portable script



* Joke de Buhr (Mon, 12 Jul 2010 17:37:19 +0200)
> On Monday 12 July 2010 16:46:22 Atom Smasher wrote:
> > on freebsd, zsh installs as /usr/local/bin/zsh. on linux (and most
> > other systems?) it installs as /usr/bin/zsh.
> > 
> > what's the best way to make zsh script portable between linux and
> > freebsd?
> > 
> > i could start the script with:
> >  	#!/usr/bin/env zsh
> > 
> > or i could specify that the script be executed as:
> >  	zsh script
> > 
> > is there a better way?
> 
> Using env doesn't solve the problem either. There is no guarantee the "env" 
> program is installed under /usr/bin/env.

It does solve the problem that's why it's used in (shell) scripting[1]. 
For Python for example it's the official way to specify the interpreter. 

I don't think "Atom Smasher" need a "guarantee" - just a confirmation 
that it does indeed work.


Thorsten
[1] http://en.wikipedia.org/wiki/Env



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