Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lsuc.UUCP Path: utzoo!lsuc!dave From: dave@lsuc.UUCP (David Sherman) Newsgroups: net.unix Subject: Re: shell compiler available Message-ID: <299@lsuc.UUCP> Date: Wed, 16-Jan-85 20:12:25 EST Article-I.D.: lsuc.299 Posted: Wed Jan 16 20:12:25 1985 Date-Received: Wed, 16-Jan-85 22:19:21 EST References: <285@varian.UUCP> Reply-To: dave@lsuc.UUCP (David Sherman) Distribution: net Organization: Law Society of Upper Canada, Toronto Lines: 42 In article <285@varian.UUCP> david@varian.UUCP (David Brown) writes: || In the latest issue of CommUNIXation ||(the publication of /usr/group), there is a press release about a ||product that translates Bourne shell scripts to C... || ||It's called shacc (shell accelerator). From the release: "Features of ||shacc included resistance to piracy, efficient use of shared text and ||the sticky bit, and effective code use with setuid files". Not to malign this particular product, since I'm not familiar with it, but think a bit about what's needed to give you all those features.... a one-line C program that exec's sh on the shell file which you are "translating". Presto, you have setUID that works, resistance to piracy because users need no longer be allowed to read the shell file, and (if you stretch the meaning slightly) shared text and sticky-bit working. As I say, I haven't seen this product. I note that they don't claim speed as a feature. Presumably, then, at best what shacc does is do what the shell does, line by line - exec the processes with the arguments requested. In other words, : shell file /* C program */ main() { echo hello system("echo hello"); for i in * system("for i in *;do tail $i;done"); do } tail $i done Of course, with some smarts you can replace thewith a real for-loop, and so on with other keywords. You could even do globbing (wildcard expansion). To make a really good product out of this, you should also do the C equivalents of many programs, e.g. echo hi printf("hi\n"); rm -f junk unlink("junk"); and so on for the most common UNIX programs. Now THAT would give you speed. Dave Sherman -- {utzoo pesnta nrcaero utcs}!lsuc!dave {allegra decvax ihnp4 linus}!utcsrgv!lsuc!dave