Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!bu.edu!nntp-read!jc From: jc@raven.bu.edu (James Cameron) Newsgroups: comp.sources.wanted Subject: Re: Executable compressor Message-ID: Date: 28 May 91 00:23:29 GMT References: <10591@castle.ed.ac.uk> Sender: news@bu.edu Distribution: comp Organization: What do you mean 'That *can't* be done????' Lines: 54 In-reply-to: eonu24@castle.ed.ac.uk's message of 27 May 91 22:39:25 GMT >>>>> On 27 May 91 22:39:25 GMT, eonu24@castle.ed.ac.uk (I Reid) said: [...deleted how to run unix executables while compressed...] |> program.exe ----> compprogram.exe (smaller than original) |> compprogram.exe - takes slightly longer than its uncompressed rival to start up |> but after that there is no noticeable difference with most |> programs |> Iain Here's a untested quick hack....It's not pretty, but it does what you are asking for. (* smile *) Let's see how many more prettier ones will be sent after this. *8-) #! /bin/csh -f # # compress and execute. Simple and sweet. Could be done better # but this does it as well as needs be. (Didn't really need the # `date` part, but just playing it safe. # set argc = $#argv if ( $argc != 1) then echo "Usage: cx prog" exit(1) endif set DATE = `date` set FNAME = "$1$DATE[4]" cp "$1.Z" "/tmp/$FNAME.Z" uncompress "/tmp/$FNAME.Z" "/tmp/$FNAME" rm "/tmp/$FNAME" jc -- -- James Cameron (jc@raven.bu.edu) Signal Processing and Interpretation Lab. Boston, Mass (617) 353-2879 ------------------------------------------------------------------------------ "But to risk we must, for the greatest hazard in life is to risk nothing. For the man or woman who risks nothing, has nothing, does nothing, is nothing." (Quote from the eulogy for the late Christa McAuliffe.)