Shell compilers
Tom Christiansen
tchrist at convex.COM
Tue Mar 12 08:44:54 AEST 1991
>From the keyboard of dichter at 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
More information about the Comp.unix.questions
mailing list