converting sh scripts to C code

Henry Spencer henry at utzoo.UUCP
Wed Jun 25 07:44:01 AEST 1986


> Has anyone out there written anything to convert sh scripts to 
> C code??  We have quite a few sh scripts around here and they
> could run *far*quicker* if converted to C...

There's at least one such commercial product, although it's probably
not worth the cost if it's only a few scripts.  However...  if you
have a modern shell (the ancient Bourne shell that comes with 4BSD
does not qualify), you may not see all that much improvement.  Once
things like "echo" become builtins, it's not clear that you save
much by avoiding the fork/exec.  Real improvement would come from
having the C program do the things that are done by sed or awk in
shell programs, and *that* conversion would be far more complex.

If you are not running the SVR2 sh or equivalent, you need to upgrade
your shell.  Only after that is accomplished is it worth considering
conversion to C, in my opinion.
-- 
Usenet(n): AT&T scheme to earn
revenue from otherwise-unused	Henry Spencer @ U of Toronto Zoology
late-night phone capacity.	{allegra,ihnp4,decvax,pyramid}!utzoo!henry



More information about the Comp.unix mailing list