version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
FUNZIP |
|
|
2 |
!!!FUNZIP |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
ARGUMENTS |
|
|
6 |
DESCRIPTION |
|
|
7 |
EXAMPLES |
|
|
8 |
BUGS |
|
|
9 |
SEE ALSO |
|
|
10 |
URL |
|
|
11 |
AUTHOR |
|
|
12 |
---- |
|
|
13 |
!!NAME |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
funzip - filter for extracting from a ZIP archive in a pipe |
|
|
17 |
!!SYNOPSIS |
|
|
18 |
|
|
|
19 |
|
|
|
20 |
__funzip__ [[__-password__] |
|
|
21 |
[[''input[[.zip|.gz]''] |
|
|
22 |
!!ARGUMENTS |
|
|
23 |
|
|
|
24 |
|
|
|
25 |
[[''-password''] |
|
|
26 |
|
|
|
27 |
|
|
|
28 |
Optional password to be used if ZIP archive is encrypted. |
|
|
29 |
Decryption may not be supported at some sites. See |
|
|
30 |
DESCRIPTION for more details. |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
[[''input[[.zip|.gz]''] |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
Optional input archive file specification. See DESCRIPTION |
|
|
37 |
for details. |
|
|
38 |
!!DESCRIPTION |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
''funzip'' without a file argument acts as a filter; that |
|
|
42 |
is, it assumes that a ZIP archive (or a ''gzip'''d(1) |
|
|
43 |
file) is being piped into standard input, and it extracts |
|
|
44 |
the first member from the archive to stdout. When stdin |
|
|
45 |
comes from a tty device, ''funzip'' assumes that this |
|
|
46 |
cannot be a stream of (binary) compressed data and shows a |
|
|
47 |
short help text, instead. If there is a file argument, then |
|
|
48 |
input is read from the specified file instead of from |
|
|
49 |
stdin. |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
A password for encrypted zip files can be specified on the |
|
|
53 |
command line (preceding the file name, if any) by prefixing |
|
|
54 |
the password with a dash. Note that this constitutes a |
|
|
55 |
security risk on many systems; currently running processes |
|
|
56 |
are often visible via simple commands (e.g., ps(1) |
|
|
57 |
under Unix), and command-line histories can be read. If the |
|
|
58 |
first entry of the zip file is encrypted and no password is |
|
|
59 |
specified on the command line, then the user is prompted for |
|
|
60 |
a password and the password is not echoed on the |
|
|
61 |
console. |
|
|
62 |
|
|
|
63 |
|
|
|
64 |
Given the limitation on single-member extraction, |
|
|
65 |
''funzip'' is most useful in conjunction with a secondary |
|
|
66 |
archiver program such as tar(1). The following |
|
|
67 |
section includes an example illustrating this usage in the |
|
|
68 |
case of disk backups to tape. |
|
|
69 |
!!EXAMPLES |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
To use ''funzip'' to extract the first member file of the |
|
|
73 |
archive test.zip and to pipe it into |
|
|
74 |
more(1): |
|
|
75 |
|
|
|
76 |
|
|
|
77 |
funzip test.zip | more |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
To use ''funzip'' to test the first member file of |
|
|
81 |
test.zip (any errors will be reported on standard |
|
|
82 |
error): |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
funzip test.zip |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
To use ''zip'' and ''funzip'' in place of |
|
|
89 |
compress(1) and zcat(1) (or ''gzip''(1L) |
|
|
90 |
and ''gzcat''(1L)) for tape backups: |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
tar cf - . | zip -7 | dd of=/dev/nrst0 obs=8k |
|
|
94 |
dd if=/dev/nrst0 ibs=8k | funzip | tar xf - |
|
|
95 |
|
|
|
96 |
|
|
|
97 |
(where, for example, nrst0 is a SCSI tape |
|
|
98 |
drive). |
|
|
99 |
!!BUGS |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
When piping an encrypted file into ''more'' and allowing |
|
|
103 |
''funzip'' to prompt for password, the terminal may |
|
|
104 |
sometimes be reset to a non-echo mode. This is apparently |
|
|
105 |
due to a race condition between the two programs; |
|
|
106 |
''funzip'' changes the terminal mode to non-echo before |
|
|
107 |
''more'' reads its state, and ''more'' then |
|
|
108 |
``restores'' the terminal to this mode before exiting. To |
|
|
109 |
recover, run ''funzip'' on the same file but redirect to |
|
|
110 |
/dev/null rather than piping into more; after prompting |
|
|
111 |
again for the password, ''funzip'' will reset the |
|
|
112 |
terminal properly. |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
There is presently no way to extract any member but the |
|
|
116 |
first from a ZIP archive. This would be useful in the case |
|
|
117 |
where a ZIP archive is included within another archive. In |
|
|
118 |
the case where the first member is a directory, |
|
|
119 |
''funzip'' simply creates the directory and |
|
|
120 |
exits. |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
The functionality of ''funzip'' should be incorporated |
|
|
124 |
into ''unzip'' itself (future release). |
|
|
125 |
!!SEE ALSO |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
''gzip''(1L), ''unzip''(1L), ''unzipsfx''(1L), |
|
|
129 |
''zip''(1L), ''zipcloak''(1L), ''zipinfo''(1L), |
|
|
130 |
''zipnote''(1L), ''zipsplit''(1L) |
|
|
131 |
!!URL |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
The Info-ZIP home page is currently at |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
http://www.info-zip.org/pub/infozip/ |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
or |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
ftp://ftp.info-zip.org/pub/infozip/ . |
|
|
144 |
!!AUTHOR |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
Mark Adler (Info-ZIP) |
|
|
148 |
---- |