Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: How to gunzip a binary on the fly
- X-seq: zsh-users 566
- From: Szekeres Istvan <szekeres@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxxx
- Subject: Re: How to gunzip a binary on the fly
- Date: Fri, 27 Dec 1996 20:09:53 +0100 (CET)
- Cc: Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>
- In-reply-to: <jarausch-961227160137.A0117741@numa1>
- Reply-to: Szekeres Istvan <szekeres@xxxxxxxxx>
If you mean the gzipped file is a shell script then it's pretty easy:
exec_gz () {
eval "$(gunzip -c $1)"
}
so you can do
exec_gz myscript.gz
In case the gzipped file is a binary (read: the file _before_ gzipping is a
binary) I think there is no way to do this. The OS (at least a few unices,
e.g. linux) needs the executable to be present as a file on a filesystem.
Pista
ps: Maybe the shell creates a temp file or pipe for the output of gunzip, I
can't check it right now.
> Hello,
> does anybody know how to gunzip a gzipped binary file just for executing it.
> Is it possible to do so without an intermediate file - just piping it
> into the shell.
>
> Assume there is a file doit.gz
>
> I would like a function exec_gz and invoke doit by exec_gz doit.gz
> without
>
> gunzip -c doit.gz >/tmp/doit
> /tmp/doit
> rm /tmp/doit
>
>
> Thanks for any hints,
>
> a Happy New Year to all of you,
>
> Helmut Jarausch.
>
>
>
>
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author