portability of non-shell scripts

David H. Brierley dave at galaxia.Newport.RI.US
Fri Jan 18 13:32:27 AEST 1991


In article <1991Jan15.233523.18150 at ux1.cso.uiuc.edu> phil at ux1.cso.uiuc.edu (Phil Howard KA9WGN) writes:
[ talks about problems when using #! construct ]
...
>... Has anyone worked a general way to make
>these script programs more portable so that they will run w/o having to
>have the user do editing on them?

How do you plan on having this work "portably" on systems that don't
support the #! mechanism?  The only thing I know of that is even close
to being portable is to assume that your script will be run by one of
the shell interpreters and have the first line of the file exec the
program that you really want run.  Make sure that you dont have anything
on this first line that is sh/ksh/csh specific because I can't gaurantee
what shell will be used to run your script.

This is one of those problems that has no real solution short of forcing
everyone to upgrade to a version of the kernel that supports the #!
mechanism (yes, the #! mechanism is implemented *inside the kernel*!!).
Since you can make a pretty good guess as to what the odds of this happening
are you can apply those same odds to coming up with a solution.
-- 
David H. Brierley
Home: dave at galaxia.Newport.RI.US    Work: dhb at quahog.ssd.ray.com
Can I be excused, my brain is full.



More information about the Comp.unix.questions mailing list