Dash:
[t2.git] / package / editors / bbe / 20-html.patch
blob27a5843b108deeb02f56d49300dbcd6e5e957444
1 From: Generated from INFO
2 Subject: The Makefile generates an updated bbe.html. These are the mods.
4 ---
5 doc/bbe.html | 94 +++++++++++++++++++++++++++++------------------------------
6 1 file changed, 47 insertions(+), 47 deletions(-)
8 --- a/doc/bbe.html
9 +++ b/doc/bbe.html
10 @@ -3,7 +3,7 @@
11 <title>bbe - binary block editor</title>
12 <meta http-equiv="Content-Type" content="text/html">
13 <meta name="description" content="bbe - binary block editor">
14 -<meta name="generator" content="makeinfo 4.8">
15 +<meta name="generator" content="makeinfo 4.13">
16 <link title="Top" rel="top" href="#Top">
17 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
18 <!--
19 @@ -40,8 +40,8 @@
20 <body>
21 <h1 class="settitle">bbe - binary block editor</h1>
22 <div class="node">
23 -<p><hr>
24 <a name="Top"></a>
25 +<p><hr>
26 Next:&nbsp;<a rel="next" accesskey="n" href="#Overview">Overview</a>,
27 Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
28 Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
29 @@ -59,12 +59,12 @@
30 this manual provided the copyright notice and this permission notice
31 are preserved on all copies.
33 - <p>Permission is granted to copy and distribute modified versions of this
34 + <p>Permission is granted to copy and distribute modified versions of this
35 manual under the conditions for verbatim copying, provided that the entire
36 resulting derived work is distributed under the terms of a permission
37 notice identical to this one.
39 - <p>Permission is granted to copy and distribute translations of this manual
40 + <p>Permission is granted to copy and distribute translations of this manual
41 into another language, under the above conditions for modified versions.
42 </blockquote>
44 @@ -79,8 +79,8 @@
45 </ul>
47 <div class="node">
48 -<p><hr>
49 <a name="Overview"></a>
50 +<p><hr>
51 Next:&nbsp;<a rel="next" accesskey="n" href="#Samples">Samples</a>,
52 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
53 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
54 @@ -97,8 +97,8 @@
55 <p><samp><span class="command">bbe</span></samp> contains also grep-like features, like printing the filename, offset and block number.
57 <div class="node">
58 -<p><hr>
59 <a name="Samples"></a>
60 +<p><hr>
61 Next:&nbsp;<a rel="next" accesskey="n" href="#Invoking-bbe">Invoking bbe</a>,
62 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Overview">Overview</a>,
63 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
64 @@ -111,28 +111,28 @@
65 Few examples of running <samp><span class="command">bbe</span></samp>:
67 <dl>
68 -<dt>`<samp><span class="samp">bbe -b "/\x80\x50\x0e/:12" -e "d 0 3" -e "c BCD ASC" -e "A \x0a" -e "w /tmp/numbers" -o /dev/null /tmp/bdata</span></samp>'<dd>Task here is to extract BCD coded numbers from the file <samp><span class="file">/tmp/bdata</span></samp> and write them
69 +<dt>&lsquo;<samp><span class="samp">bbe -b "/\x80\x50\x0e/:12" -e "d 0 3" -e "c BCD ASC" -e "A \x0a" -e "w /tmp/numbers" -o /dev/null /tmp/bdata</span></samp>&rsquo;<dd>Task here is to extract BCD coded numbers from the file <samp><span class="file">/tmp/bdata</span></samp> and write them
70 in ascii format with newline to file <samp><span class="file">/tmp/numbers</span></samp>.
71 12 bytes long blocks containing the BCD-numbers start with three byte sequence of
72 -values `<samp><span class="samp">0x80</span></samp>', `<samp><span class="samp">0x50</span></samp>' and `<samp><span class="samp">0x0e</span></samp>'. First three bytes (the block start sequence)
73 -are removed (`<samp><span class="samp">d 0 3</span></samp>') rest of the block is transformed from BCD to Ascii (`<samp><span class="samp">c BCD ASC</span></samp>') and a newline character is
74 -appended at the end of the block (`<samp><span class="samp">A \x0a</span></samp>').
75 -All transformed blocks are written to <samp><span class="file">/tmp/numbers</span></samp> (`<samp><span class="samp">w /tmp/numbers</span></samp>'). Nothing is written to
76 -the output (`<samp><span class="samp">-o /dev/null</span></samp>').
77 +values &lsquo;<samp><span class="samp">0x80</span></samp>&rsquo;, &lsquo;<samp><span class="samp">0x50</span></samp>&rsquo; and &lsquo;<samp><span class="samp">0x0e</span></samp>&rsquo;. First three bytes (the block start sequence)
78 +are removed (&lsquo;<samp><span class="samp">d 0 3</span></samp>&rsquo;) rest of the block is transformed from BCD to Ascii (&lsquo;<samp><span class="samp">c BCD ASC</span></samp>&rsquo;) and a newline character is
79 +appended at the end of the block (&lsquo;<samp><span class="samp">A \x0a</span></samp>&rsquo;).
80 +All transformed blocks are written to <samp><span class="file">/tmp/numbers</span></samp> (&lsquo;<samp><span class="samp">w /tmp/numbers</span></samp>&rsquo;). Nothing is written to
81 +the output (&lsquo;<samp><span class="samp">-o /dev/null</span></samp>&rsquo;).
82 <br>
84 - <br><dt>`<samp><span class="samp">bbe -b ":525" -e "i 524 \x0a" -o /tmp/data_with_nl /tmp/data</span></samp>'<dd>A newline is added after every 525'th byte of the file <samp><span class="file">/tmp/data</span></samp>. Data with newlines is written to <samp><span class="file">/tmp/data_with_nl</span></samp>.
85 + <br><dt>&lsquo;<samp><span class="samp">bbe -b ":525" -e "i 524 \x0a" -o /tmp/data_with_nl /tmp/data</span></samp>&rsquo;<dd>A newline is added after every 525'th byte of the file <samp><span class="file">/tmp/data</span></samp>. Data with newlines is written to <samp><span class="file">/tmp/data_with_nl</span></samp>.
86 <br>
88 - <br><dt>`<samp><span class="samp">bbe -b ":526" -e "d 525 1" -o /tmp/data /tmp/data_with_nl</span></samp>'<dd>Every 526'th byte (inserted newline in previous example) is removed from the file <samp><span class="file">/tmp/data_with_nl</span></samp>. Data without newlines is written to <samp><span class="file">/tmp/data</span></samp>.
89 + <br><dt>&lsquo;<samp><span class="samp">bbe -b ":526" -e "d 525 1" -o /tmp/data /tmp/data_with_nl</span></samp>&rsquo;<dd>Every 526'th byte (inserted newline in previous example) is removed from the file <samp><span class="file">/tmp/data_with_nl</span></samp>. Data without newlines is written to <samp><span class="file">/tmp/data</span></samp>.
90 <br>
92 - <br><dt>`<samp><span class="samp">bbe -e "s/\x0d\x0a/\x0a/"</span></samp>'<dd>Same effect as has command <samp><span class="command">dos2unix</span></samp>.
93 + <br><dt>&lsquo;<samp><span class="samp">bbe -e "s/\x0d\x0a/\x0a/"</span></samp>&rsquo;<dd>Same effect as has command <samp><span class="command">dos2unix</span></samp>.
94 </dl>
96 <div class="node">
97 -<p><hr>
98 <a name="Invoking-bbe"></a>
99 +<p><hr>
100 Next:&nbsp;<a rel="next" accesskey="n" href="#bbe-programs">bbe programs</a>,
101 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Samples">Samples</a>,
102 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
103 @@ -155,8 +155,8 @@
104 </ul>
106 <div class="node">
107 -<p><hr>
108 <a name="Invocation"></a>
109 +<p><hr>
110 Next:&nbsp;<a rel="next" accesskey="n" href="#Block">Block</a>,
111 Up:&nbsp;<a rel="up" accesskey="u" href="#Invoking-bbe">Invoking bbe</a>
113 @@ -172,7 +172,7 @@
114 <p><code>bbe</code> supports the following options:
116 <!-- Formatting copied from the Texinfo 4.0 manual. -->
117 -<dl>
118 + <dl>
119 <dt><code>-b </code><var>BLOCK</var><dt><code>--block=</code><var>BLOCK</var><dd>Block definition.
121 <br><dt><code>-e </code><var>COMMAND</var><dt><code>--expression=</code><var>COMMAND</var><dd>Add command(s) to the commands to be executed. Commands must be separated by semicolon.
122 @@ -192,8 +192,8 @@
123 <p>All remaining options are names of input files, if no input files are specified or <code>-</code> is given, then the standard input is read.
125 <div class="node">
126 -<p><hr>
127 <a name="Block"></a>
128 +<p><hr>
129 Next:&nbsp;<a rel="next" accesskey="n" href="#Commands">Commands</a>,
130 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invocation">Invocation</a>,
131 Up:&nbsp;<a rel="up" accesskey="u" href="#Invoking-bbe">Invoking bbe</a>
132 @@ -268,8 +268,8 @@
133 </dl>
135 <div class="node">
136 -<p><hr>
137 <a name="Commands"></a>
138 +<p><hr>
139 Next:&nbsp;<a rel="next" accesskey="n" href="#Limits">Limits</a>,
140 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Block">Block</a>,
141 Up:&nbsp;<a rel="up" accesskey="u" href="#Invoking-bbe">Invoking bbe</a>
142 @@ -316,9 +316,9 @@
143 <br><dt><code>B </code><var>f</var><dd>Before block contents the current block number and colon is printed in format specified by <var>f</var>.
144 Block numbering starts at one. <var>f</var> can have one of the sames codes as <code>F</code>-command.
146 - <br><dt><code>&gt; <samp></code><span class="file">file</span><code></samp></code><dd>Before printing a block, the contents of file <samp><span class="file">file</span></samp> is printed.
147 + <br><dt><code>&gt; </code><samp><span class="file">file</span></samp><dd>Before printing a block, the contents of file <samp><span class="file">file</span></samp> is printed.
149 - <br><dt><code>&lt; <samp></code><span class="file">file</span><code></samp></code><dd>After printing a block, the contents of file <samp><span class="file">file</span></samp> is printed.
150 + <br><dt><code>&lt; </code><samp><span class="file">file</span></samp><dd>After printing a block, the contents of file <samp><span class="file">file</span></samp> is printed.
151 </dl>
153 <h4 class="subheading">Byte commands are:</h4>
154 @@ -368,7 +368,7 @@
155 <br><dt><code>s/</code><var>search</var><code>/</code><var>replace</var><code>/</code><dd>All occurences of <var>search</var> are replaced by <var>replace</var>. <var>replace</var> can be empty. Separator <code>/</code> can be replaced by any
156 character not present in <var>search</var> or <var>replace</var>.
158 - <br><dt><code>w <samp></code><span class="file">file</span><code></samp></code><dd>Contents of blocks are written to file <samp><span class="file">file</span></samp>. <strong>Note</strong>: Data inserted by commands <code>A</code>, <code>I</code>,
159 + <br><dt><code>w </code><samp><span class="file">file</span></samp><dd>Contents of blocks are written to file <samp><span class="file">file</span></samp>. <strong>Note</strong>: Data inserted by commands <code>A</code>, <code>I</code>,
160 <code>&gt;</code> and <code>&lt;</code>
161 are written to file <samp><span class="file">file</span></samp> and <code>j</code> and <code>l</code> commands have no effect on <code>w</code>-commands. Zero size files are not preserved.<br>
162 Filename can contain format string <code>%B</code> or <code>%nB</code>, these format strings are replace by current block number (starting from one), causing every block to have it's own file.
163 @@ -389,8 +389,8 @@
164 </dl>
166 <div class="node">
167 -<p><hr>
168 <a name="Limits"></a>
169 +<p><hr>
170 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Commands">Commands</a>,
171 Up:&nbsp;<a rel="up" accesskey="u" href="#Invoking-bbe">Invoking bbe</a>
173 @@ -409,8 +409,8 @@
174 </dl>
176 <div class="node">
177 -<p><hr>
178 <a name="bbe-programs"></a>
179 +<p><hr>
180 Next:&nbsp;<a rel="next" accesskey="n" href="#Problems">Problems</a>,
181 Previous:&nbsp;<a rel="previous" accesskey="p" href="#Invoking-bbe">Invoking bbe</a>,
182 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
183 @@ -420,7 +420,7 @@
184 <h2 class="chapter">4 How <samp><span class="command">bbe</span></samp> works</h2>
186 <p><samp><span class="command">bbe</span></samp> scans the input stream just once, so the last block may differ from the block definition, because <samp><span class="command">bbe</span></samp> doesn't
187 -'peek' the end of the input stream. Last block may be shorter than defined, e.g. if block is defined as `<samp><span class="samp">/string/:128</span></samp>'
188 +'peek' the end of the input stream. Last block may be shorter than defined, e.g. if block is defined as &lsquo;<samp><span class="samp">/string/:128</span></samp>&rsquo;
189 and if the end of input stream is found before 128'th byte of the last block is reached, the last block remains shorter.
191 <h4 class="subheading">Basic execution cycle:</h4>
192 @@ -443,15 +443,15 @@
193 <h4 class="subheading">Few examples:</h4>
195 <dl>
196 -<dt>`<samp><span class="samp">echo "The quick brown fox jumps over a lazy dog" | bbe -b "/The/:21" -e "j 4" -e "s/ /X/"</span></samp>'<dd>Output is
197 +<dt>&lsquo;<samp><span class="samp">echo "The quick brown fox jumps over a lazy dog" | bbe -b "/The/:21" -e "j 4" -e "s/ /X/"</span></samp>&rsquo;<dd>Output is
198 <pre class="example"> The quickXbrownXfoxXjumps over a lazy dog
199 - </pre>
200 +</pre>
201 <p>The only block in this is
202 <pre class="example"> The quick brown fox j
203 - </pre>
204 +</pre>
205 <p>All spaces in the block are converted to X's, before conversion first 4 bytes are skipped.<br>
207 - <br><dt>`<samp><span class="samp">echo "The quick brown fox jumps over a lazy dog" | bbe -b ":/ /" -e "J 1" -e "A \x0a"</span></samp>'<dd>Output is:
208 + <br><dt>&lsquo;<samp><span class="samp">echo "The quick brown fox jumps over a lazy dog" | bbe -b ":/ /" -e "J 1" -e "A \x0a"</span></samp>&rsquo;<dd>Output is:
209 <pre class="example"> The quick
210 brown
212 @@ -461,57 +461,57 @@
213 lazy
216 - </pre>
217 +</pre>
218 <p>All blocks end at space, a newline character is inserted after every block except the first block.<br>
220 - <br><dt>`<samp><span class="samp">echo "The quick brown fox jumps over a lazy dog" | bbe -e "r 4 fast\x20" -e "s/f/c/"</span></samp>'<dd>Output is:
221 + <br><dt>&lsquo;<samp><span class="samp">echo "The quick brown fox jumps over a lazy dog" | bbe -e "r 4 fast\x20" -e "s/f/c/"</span></samp>&rsquo;<dd>Output is:
222 <pre class="example"> The cast brown cox jumps over a lazy dog
223 - </pre>
224 +</pre>
225 <p>Also the <code>f</code> in <code>fast</code> is converted to <code>c</code>.<br>
227 - <br><dt>`<samp><span class="samp">echo "1234567890" | bbe -b ":1" -e "L 9" -e "A -"</span></samp>'<dd>Output is
228 + <br><dt>&lsquo;<samp><span class="samp">echo "1234567890" | bbe -b ":1" -e "L 9" -e "A -"</span></samp>&rsquo;<dd>Output is
229 <pre class="example"> 1-2-3-4-5-6-7-8-9-0
230 - </pre>
231 +</pre>
232 <p>Hyphen is inserted after every 1 byte long block,but not after 9'th block.<br>
234 - <br><dt>`<samp><span class="samp">bbe -s -b "/First line/:/Last line/" /tmp/text</span></samp>'<dd>Print lines between sentences `<samp><span class="samp">First line</span></samp>' and `<samp><span class="samp">Last line</span></samp>'.<br>
235 + <br><dt>&lsquo;<samp><span class="samp">bbe -s -b "/First line/:/Last line/" /tmp/text</span></samp>&rsquo;<dd>Print lines between sentences &lsquo;<samp><span class="samp">First line</span></samp>&rsquo; and &lsquo;<samp><span class="samp">Last line</span></samp>&rsquo;.<br>
237 - <br><dt>`<samp><span class="samp">bbe -s -b "%&lt;a %:%&lt;/a&gt;%" -e "s/\x0a/ /" -e "A \n" ./index.html</span></samp>'<dd>Extract all links from <samp><span class="file">./index.html</span></samp>. To get one link per line,
238 + <br><dt>&lsquo;<samp><span class="samp">bbe -s -b "%&lt;a %:%&lt;/a&gt;%" -e "s/\x0a/ /" -e "A \n" ./index.html</span></samp>&rsquo;<dd>Extract all links from <samp><span class="file">./index.html</span></samp>. To get one link per line,
239 all newlines are converted to spaces and newline is added after every link.<br>
241 - <br><dt>`<samp><span class="samp">bbe -b "/\x5f\x28\x02/:10" -s -e "F d" -e "p h" -e "A \n" ./bindata</span></samp>'<dd>10 bytes long sequences starting with values <code>x5f</code> <code>x28</code> and <code>x02</code> are printed as hex values.
242 + <br><dt>&lsquo;<samp><span class="samp">bbe -b "/\x5f\x28\x02/:10" -s -e "F d" -e "p h" -e "A \n" ./bindata</span></samp>&rsquo;<dd>10 bytes long sequences starting with values <code>x5f</code> <code>x28</code> and <code>x02</code> are printed as hex values.
243 Also the file offset is printed before each sequence and new line is added after every sequence.
244 Example output:
245 <pre class="example"> 52688:x5f x28 x02 x32 x36 x5f x81 x64 x01 x93
246 68898:x5f x28 x02 x39 x46 x5f x81 x64 x41 x05
247 69194:x5f x28 x02 x42 x36 x5f x81 x64 x41 x05
248 - </pre>
249 +</pre>
250 <p><br>
252 - <br><dt>`<samp><span class="samp">bbe -b "/Linux/:5" -s -e "N;D;A \x0a" /bin/* | uniq</span></samp>'<dd>Print the file names of those programs in /bin directory which contains word `<samp><span class="samp">Linux</span></samp>'.
253 + <br><dt>&lsquo;<samp><span class="samp">bbe -b "/Linux/:5" -s -e "N;D;A \x0a" /bin/* | uniq</span></samp>&rsquo;<dd>Print the file names of those programs in /bin directory which contains word &lsquo;<samp><span class="samp">Linux</span></samp>&rsquo;.
254 Example output:
255 <pre class="example"> /bin/loadkeys:
256 /bin/mkbimage:
257 /bin/ps:
258 /bin/uname:
259 - </pre>
260 +</pre>
261 <p><br>
263 - <br><dt>`<samp><span class="samp">bbe -b "/\x5f\x81\x18\x06/:10" -s -e "B d;d 0 4;c BCD ASC;A \n" ./bindata</span></samp>'<dd>Print BCD numbers and their block numbers in ascii format. Numbers start with sequence <code>x5f</code> <code>x81</code> <code>x18</code> <code>x06</code>.
264 + <br><dt>&lsquo;<samp><span class="samp">bbe -b "/\x5f\x81\x18\x06/:10" -s -e "B d;d 0 4;c BCD ASC;A \n" ./bindata</span></samp>&rsquo;<dd>Print BCD numbers and their block numbers in ascii format. Numbers start with sequence <code>x5f</code> <code>x81</code> <code>x18</code> <code>x06</code>.
265 The start sequence is not printed.<br>
267 - <br><dt>`<samp><span class="samp">bbe -b "/\x5f/:2" -e "j 1;&amp; \xf0" -o newdata bindata</span></samp>'<dd>The least significant nybble of bytes after <code>x5f</code> is cleared.<br>
268 + <br><dt>&lsquo;<samp><span class="samp">bbe -b "/\x5f/:2" -e "j 1;&amp; \xf0" -o newdata bindata</span></samp>&rsquo;<dd>The least significant nybble of bytes after <code>x5f</code> is cleared.<br>
270 - <br><dt>`<samp><span class="samp">bbe -b "/\xff\xd8\xff/:/\xff\xd9/" -s -e "w pic%02B.jpg" -o /dev/null manual.pdf</span></samp>'<dd>Extract jpg-images from pdf-file to separate jpg-files (assuming that the jpg start/stop sequences
271 + <br><dt>&lsquo;<samp><span class="samp">bbe -b "/\xff\xd8\xff/:/\xff\xd9/" -s -e "w pic%02B.jpg" -o /dev/null manual.pdf</span></samp>&rsquo;<dd>Extract jpg-images from pdf-file to separate jpg-files (assuming that the jpg start/stop sequences
272 does not appear in other context than jpg-images).
273 Files will be named as <samp><span class="file">pic01.jpg</span></samp>, <samp><span class="file">pic02.jpg</span></samp>, <samp><span class="file">pic03.jpg</span></samp>,<small class="dots">...</small> <br>
275 - <br><dt>`<samp><span class="samp">bbe -b "_&lt;body&gt;_:_&lt;/body&gt;_" -s -o temp nicebody.html</span></samp>'<dt>`<samp><span class="samp">bbe -b "_&lt;body&gt;_:_&lt;/body&gt;_" -e "D;&lt; temp" -o tmpindex.html index.html</span></samp>'<dt>`<samp><span class="samp">mv tmpindex.html index.html</span></samp>'<dd>The body part of the html-document <samp><span class="file">index.html</span></samp> is replaced by the body of the document <samp><span class="file">nicebody.html</span></samp>.
276 + <br><dt>&lsquo;<samp><span class="samp">bbe -b "_&lt;body&gt;_:_&lt;/body&gt;_" -s -o temp nicebody.html</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">bbe -b "_&lt;body&gt;_:_&lt;/body&gt;_" -e "D;&lt; temp" -o tmpindex.html index.html</span></samp>&rsquo;<dt>&lsquo;<samp><span class="samp">mv tmpindex.html index.html</span></samp>&rsquo;<dd>The body part of the html-document <samp><span class="file">index.html</span></samp> is replaced by the body of the document <samp><span class="file">nicebody.html</span></samp>.
277 </dl>
279 <div class="node">
280 -<p><hr>
281 <a name="Problems"></a>
282 +<p><hr>
283 Previous:&nbsp;<a rel="previous" accesskey="p" href="#bbe-programs">bbe programs</a>,
284 Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
286 @@ -522,7 +522,7 @@
287 <p><a name="index-bugs-11"></a><a name="index-problems-12"></a>
288 If you find a bug in <samp><span class="command">bbe</span></samp>, please send electronic mail to
289 <a href="mailto:tjsa@iki.fi">tjsa@iki.fi</a>. Include the version number, which you can find by
290 -running `<samp><span class="samp">bbe&nbsp;--version</span></samp>'<!-- /@w -->. Also include in your message the
291 +running &lsquo;<samp><span class="samp">bbe&nbsp;--version</span></samp>&rsquo;<!-- /@w -->. Also include in your message the
292 output that the program produced and the output you expected.
294 <p>If you have other questions, comments or suggestions about