Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!rbj From: rbj@uunet.UU.NET (Root Boy Jim) Newsgroups: comp.unix.internals Subject: Re: executing a stream / a compressed file Message-ID: <122770@uunet.UU.NET> Date: 15 Feb 91 19:56:40 GMT References: <1991Jan15.204849@IASTATE.EDU> <118868@uunet.UU.NET> <9950@dog.ee.lbl.gov> Organization: UUNET Communications Services, Falls Church, VA Lines: 46 In article <9950@dog.ee.lbl.gov> torek@elf.ee.lbl.gov (Chris Torek) writes: >>In <1991Jan15.204849@IASTATE.EDU> spam@IASTATE.EDU (Begley Michael L) writes: >>>What I'd like to do is execute a stream. [eg] >>> uncompress -c microemacs|execute > >In article <118868@uunet.UU.NET> rbj@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@uunet 1] stty sane unknown mode: sane