[Ilugc] Using sha-bang..

  • From: knutties@xxxxxxxxx (Natarajan K)
  • Date: Fri Jul 8 22:48:40 2005

assumed to be on /bin/sh but this is not the case with other
interpreters. One solution suggested is to use env to find out the
executable using PATH. However, it turns out that the location of env
itself is not standard. I've seen systems with it being in /bin as
well as /usr/bin. Is their any good solution for this ?

Googling and some subsequent reading did not give me a satisfactory
response to your query. But if the location of the executables (more
importantly, the shell) across distros/Unix flavours itself is not
standardized, then it just might not be possible to have uber
portability. Using /bin/sh does guarantee portability, but could be at
the expense of functionality I guess.

I know this post does not answer your query, but I came across a few
interesting solutions to the problem. One was to do away with shebang
itself (http://homepages.cwi.nl/~aeb/std/shebang/)

The Debian policy on scripts makes things pretty clear. Use /bin/sh
(which could be a link to a POSIX compliant shell) If you use
non-POSIX shell, add a approriate shebang line and make your script
dependent on the shell package.

Natarajan
-- 
http://puggy.symonds.net/~natarajan

Other related posts: