executing a stream / a compressed file

Root Boy Jim rbj at uunet.UU.NET
Sat Feb 16 06:56:40 AEST 1991


In article <9950 at dog.ee.lbl.gov> torek at elf.ee.lbl.gov (Chris Torek) writes:
>>In <1991Jan15.204849 at IASTATE.EDU> spam at IASTATE.EDU (Begley Michael L) writes:
>>>What I'd like to do is execute a stream. [eg]
>>>   uncompress -c microemacs|execute
>
>In article <118868 at uunet.UU.NET> rbj at uunet.UU.NET (Root Boy Jim) writes:
>>I once suggested to Chris Torek that the kernel should execute
>>compressed programs. He groaned.

[Good explanation deleted]

Well, I was half kidding. On the other hand, consider files as objects.
Right now, the only "message" you can send them is "execute yourself
with these arguments".

Right now, we embed the messages in programs which know about the
format of their data. Strip removes the symbol table from
executables, for example. What would it mean to strip a perl, awk, 
or shell script, or perhaps an include file? Most likely,
decommenting, squishing, and unifdefing.

Consider the message "delete yourself". Smart files could figure
out where to archive themselves, or stubbornly refuse to die.

Objects and executables would refuse to "print".

Isn't it time for oonix?

I became intrigued with what kinds of interpreters one could
slap on the beginning of files besides #! /bin/sh. There is
"more +2" to make a file self page, as well as awk and perl.

Around here, we have some huge log files which people tail -f.
So I prepended #! tail -f to them and made them executable!

It would be nice to be able to prepend #! uncompress+exec
to a compressed binary and have it do what Chris suggested,
leave the file uncompressed then execute it.

In fact, that's what I did with my autoload, load, and unload
scripts which I posted to c.u.w. when this whole discussion started.

Clearly this can all be done in user code. And it should be.
-- 
		[rbj at uunet 1] stty sane
		unknown mode: sane



More information about the Comp.unix.internals mailing list