source: zzuf/trunk/doc/zzcat.1.in @ 4289

Last change on this file since 4289 was 4289, checked in by Sam Hocevar, 11 years ago

Add a debug mode to zzcat.

File size: 3.7 KB
Line 
1.TH zzcat 1 "2010-01-07" "zzcat @PACKAGE_VERSION@"
2.SH NAME
3zzcat \- concatenate files using different instruction sequences
4.SH SYNOPSIS
5\fBzzcat\fR [\fB\-AbdeEntTv\fR] [\fB\-r\fR \fIloops\fR]
6[\fB\-x\fR \fIsequence\fR] [\fIFILE\fR]...
7.br
8\fBzzcat \-l\fR | \fB\-\-list\fR
9.br
10\fBzzcat \-h\fR | \fB\-\-help\fR
11.br
12\fBzzcat \-V\fR | \fB\-\-version\fR
13.SH DESCRIPTION
14.PP
15The \fBzzcat\fR utility reads files sequentially, writing them to the
16standard output. The user can decide which sequence of library calls is
17used to seek and read data.
18
19\fBzzcat\fR is primarily used as a debugging tool for \fBzzuf\fR, because
20it can emulate different programs' ways to read files.
21.SH OPTIONS
22.TP
23\fB\-A\fR, \fB\-\-show\-all\fR
24Equivalent to \fB\-vET\fR.
25.TP
26\fB\-b\fR, \fB\-\-number\-nonblank\fR
27Number nonempty output lines.
28.TP
29\fB\-d\fR, \fB\-\-debug\fR
30Output debugging information.
31.TP
32\fB\-e\fR
33Equivalent to \fB\-vET\fR.
34.TP
35\fB\-E\fR, \fB\-\-show\-ends\fR
36Display $ at end of each line.
37.TP
38\fB\-n\fR, \fB\-\-number\fR
39Number all output lines.
40.TP
41\fB\-r\fR, \fB\-\-repeat\fR=\fIloops\fR
42Concatenate all files \fIloops\fR times.
43.TP
44\fB\-t\fR
45Equivalent to \fB\-vT\fR.
46.TP
47\fB\-T\fR, \fB\-\-show\-tabs\fR
48Display TAB characters as ^I.
49.TP
50\fB\-v\fR, \fB\-\-show\-nonprinting\fR
51Use ^ and M- notation, except for LFD and TAB.
52.TP
53\fB\-x\fR, \fB\-\-execute\fR=\fIsequence\fR
54Read a file or a stream using the instruction sequence specified in
55\fIsequence\fR.
56
57Instructions are executed sequentially until the end of the program.
58End-of-file is not an exit condition, except where the \fBfeof\fR keyword is
59used:
60
61\fB    fread(1,10); feof(1); fread(1,10)\fR
62
63Loops are permitted using the \fBrepeat\fR keyword. Again, \fBfeof\fR can be
64used to prematurely break out of a loop:
65
66\fB    repeat(10000, fgetc() feof(1))\fR
67
68Instructions can be separated by spaces, commas or semicolons.
69A list of all available instructions and control keywords can be obtained
70using this command:
71
72\fB    zzcat \-l\fR
73
74If no sequence is specified, the following default sequence is used:
75
76\fB    repeat(\-1, fread(1,32768), feof(1))\fR
77
78.TP
79\fB\-l\fR, \fB\-\-list\fR
80Display the list of supported keywords and functions and exit.
81.TP
82\fB\-h\fR, \fB\-\-help\fR
83Display a short help message and exit.
84.TP
85\fB\-V\fR, \fB\-\-version\fR
86Output version information and exit.
87.SH EXAMPLES
88.PP
89Read the first 1000 bytes of f, then exit:
90.PP
91\fB    zzcat \-x \(aqfread(1,1000)\(aq f\fR
92.PP
93Read the first four bytes of f, using four different instructions:
94.PP
95\fB    zzcat \-x \(aqgetc(),fgetc(),getc_unlocked(),_IO_getc()\(aq f\fR
96.PP
97Read f entirely, by calling \fBgetc()\fR repeatedly until end-of-file is
98reached:
99.PP
100\fB    zzcat \-x \(aqrepeat(\-1, getc(), feof(1))\(aq \fRf
101.PP
102Read f entirely, in chunks of 32768 bytes until end-of-file is reached:
103.PP
104\fB    zzcat \-x \(aqrepeat(\-1, fread(1,32768), feof(1))\(aq \fRf
105.\" .PP
106.\" Read only odd bytes, rewind file, then read all even bytes:
107.\" .PP
108.\" \fB    zzcat \-x \(aqrepeat(\-1, getc(), feof(1), fseek(1,SEEK_CUR)),
109.\" \fB              rewind(),
110.\" \fB              repeat(\-1, fseek(1,SEEK_CUR), getc(), feof(1))\(aq
111.SH SEE ALSO
112.PP
113\fBzzuf(3)\fR, \fBlibzzuf(3)\fR
114.SH AUTHOR
115.PP
116Copyright \(co 2002\-2010 Sam Hocevar <sam@hocevar.net>.
117.PP
118\fBzzcat\fR and this manual page are free software. They come without any
119warranty, to the extent permitted by applicable law. You can redistribute
120them and/or modify them under the terms of the Do What The Fuck You Want
121To Public License, Version 2, as published by Sam Hocevar. See
122\fBhttp://sam.zoy.org/wtfpl/COPYING\fR for more details.
123.PP
124\fBzzuf\fR's webpage can be found at \fBhttp://caca.zoy.org/wiki/zzuf\fR.
125An overview of the architecture and inner works is at
126\fBhttp://caca.zoy.org/wiki/zzuf/internals\fR.
Note: See TracBrowser for help on using the repository browser.