>A shell script is not compiled and linked so we can't have an exec.
>version of it as we have in a programming lang. . Is there a way that
>after writing a (bourne ) shell script we make it executable and just
>give the executable version to somebody (making a script executable by
>chmod does not make a seperate exec. version and to give somebody you
>have to give the script itself).
Why do you want to do this? I can think of two reasons...
(1) For security (you don't want them having the source to your script)
Easy enough. Make a C program which has the script text as data.
Use Popen() to exec a copy of the shell, with an input pipe to
it. Stuff the script text into the pipe and watch what comes out.
Or write stuff to a temp file, fork(), exec(/bin/sh,tmpfile),
then when /bin/sh terminates, erase the file.
(2) For completeness (in case they don't have /bin/sh)
who doesn't have at least /bin/sh?????
I'd guess you're more concerned about (1) than (2).
Andy
--
:-------------------------------------------------------------------------:
: "Life is what we make of it, but we have to make up our mind first!" :
:-------------------------------------------------------------------------: