[comp.unix.questions] Shell compilers

bernie@DIALix.oz.au (Bernd Felsche) (10/22/90)

Does anybody out there know of Broune shell script "compilers", 
specifically those which generate C language.  We have a large 
suite of shell scripts which we want to protect from tampering.

Perhaps more importantly; is there anybody using these, and what are
the traps?

Thanks in advance.

-- 
 ________Bernd_Felsche__________bernie@DIALix.oz.au_____________
[ Phone: +61 9 419 2297		19 Coleman Road			]
[ TZ:	 UTC-8			Calista, Western Australia 6167	]

dichter@chdasic.sps.mot.com (Carl Dichter) (03/12/91)

I am looking for compilers for shell scripts.

I am particularly intrested in Bourne shell compilers,
but you can send me information on any shell language compilers.

I'll post a summary.

Thanks in advance,

Carl R. Dichter 
Staff Software Engineer/Scientist
Motorola ASIC Division

PS: I realize that you can use "#!/bin/sh" at the start
of the file to cause it to be interpreted by the correct
shell, but a compiled shell script is prefered for speed
and source protection.

tchrist@convex.COM (Tom Christiansen) (03/12/91)

From the keyboard of dichter@chdasic.sps.mot.com (Carl Dichter):
:I am looking for compilers for shell scripts.
:
:I am particularly intrested in Bourne shell compilers,
:but you can send me information on any shell language compilers.
:
:PS: I realize that you can use "#!/bin/sh" at the start
:of the file to cause it to be interpreted by the correct
:shell, but a compiled shell script is prefered for speed
:and source protection.

This would actually buy you very little.  The slowness of a shell script
could be helped just a little if you could compile the conditionals, but
the principal source of lentitude is the algorithm people tend to use in
shell scripts.

The big problem with piping tools together is that there is only one
pipe.  This means that several different data streams have to get
multiplexed into a single data stream, then demuxed on the other end of
the pipe.  This wastes processor time as well as human brain power.

For example, you might be shuffling through a pipe a list of filenames,
but you also want to indicate that certain files have a particular
attribute, and others don't.  (E.g., certain files are more than ten
days old.)  Typically, this information is encoded in the data stream
by appending or prepending some special marker string to the filename.
This means that both the pipe feeder and the pipe reader need to know
about it.  Not a pretty sight.

I haven't met a shell script yet I couldn't make a lot faster by
translating into a perl program.  (I know: I was telegraphing my punch.)

As for source protection, is what you're doing in your script really 
so important to your company's livelihood that you have to hide it?

--tom