04-07-05 01:48 AM
khoa nguyen wrote:
> Hi,
>
> I would like to zip from stdin, e.g. through some pipe, into a zip
> archive. When I unzip the file I would get "./-" as the unzipped file.
> I'd like to unzip to some other logical name and not "./-".
>
> For example,
>
> [begin scenario]
> % echo 'hello world' | zip > hello.zip
> % unzip hello.zip
> [end scenario]
>
> unzipping hello.zip will produce a "./-" file.
Zip is a container format, like tar. It can contain more than one
file, so zipping from standard input would be difficult.
If you just want to zip one file, use gzip instead. With
parameter -9 it has much better compression, too.
% cat foo.txt | gzip -9 > foo.txt.gz
% gunzip foo.txt.gz
[ Post a follow-up to this message ]
|