From: Generated from INFO Subject: The Makefile generates an updated bbe.html. These are the mods. --- doc/bbe.html | 94 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 47 insertions(+), 47 deletions(-) --- a/doc/bbe.html +++ b/doc/bbe.html @@ -3,7 +3,7 @@ bbe - binary block editor - + -
+
-b BLOCK
--block=BLOCK
Block definition.
-e COMMAND
--expression=COMMAND
Add command(s) to the commands to be executed. Commands must be separated by semicolon. @@ -192,8 +192,8 @@

All remaining options are names of input files, if no input files are specified or - is given, then the standard input is read.

-


+


Next: , Previous: Invocation, Up: Invoking bbe @@ -268,8 +268,8 @@
-


+


Next: , Previous: Block, Up: Invoking bbe @@ -316,9 +316,9 @@
B f
Before block contents the current block number and colon is printed in format specified by f. Block numbering starts at one. f can have one of the sames codes as F-command. -
> file
Before printing a block, the contents of file file is printed. +
> file
Before printing a block, the contents of file file is printed. -
< file
After printing a block, the contents of file file is printed. +
< file
After printing a block, the contents of file file is printed.

Byte commands are:

@@ -368,7 +368,7 @@
s/search/replace/
All occurences of search are replaced by replace. replace can be empty. Separator / can be replaced by any character not present in search or replace. -
w file
Contents of blocks are written to file file. Note: Data inserted by commands A, I, +
w file
Contents of blocks are written to file file. Note: Data inserted by commands A, I, > and < are written to file file and j and l commands have no effect on w-commands. Zero size files are not preserved.
Filename can contain format string %B or %nB, these format strings are replace by current block number (starting from one), causing every block to have it's own file. @@ -389,8 +389,8 @@
-


+


Previous: Commands, Up: Invoking bbe @@ -409,8 +409,8 @@
-


+


Next: , Previous: Invoking bbe, Up: Top @@ -420,7 +420,7 @@

4 How bbe works

bbe scans the input stream just once, so the last block may differ from the block definition, because bbe doesn't -'peek' the end of the input stream. Last block may be shorter than defined, e.g. if block is defined as `/string/:128' +'peek' the end of the input stream. Last block may be shorter than defined, e.g. if block is defined as ‘/string/:128’ and if the end of input stream is found before 128'th byte of the last block is reached, the last block remains shorter.

Basic execution cycle:

@@ -443,15 +443,15 @@

Few examples:

-
`echo "The quick brown fox jumps over a lazy dog" | bbe -b "/The/:21" -e "j 4" -e "s/ /X/"'
Output is +
echo "The quick brown fox jumps over a lazy dog" | bbe -b "/The/:21" -e "j 4" -e "s/ /X/"
Output is
          The quickXbrownXfoxXjumps over a lazy dog
-     
+

The only block in this is

          The quick brown fox j
-     
+

All spaces in the block are converted to X's, before conversion first 4 bytes are skipped.
-

`echo "The quick brown fox jumps over a lazy dog" | bbe -b ":/ /" -e "J 1" -e "A \x0a"'
Output is: +
echo "The quick brown fox jumps over a lazy dog" | bbe -b ":/ /" -e "J 1" -e "A \x0a"
Output is:
          The quick
           brown
           fox
@@ -461,57 +461,57 @@
           lazy
           dog
           
-     
+

All blocks end at space, a newline character is inserted after every block except the first block.
-

`echo "The quick brown fox jumps over a lazy dog" | bbe -e "r 4 fast\x20" -e "s/f/c/"'
Output is: +
echo "The quick brown fox jumps over a lazy dog" | bbe -e "r 4 fast\x20" -e "s/f/c/"
Output is:
          The cast  brown cox jumps over a lazy dog
-     
+

Also the f in fast is converted to c.
-

`echo "1234567890" | bbe -b ":1" -e "L 9" -e "A -"'
Output is +
echo "1234567890" | bbe -b ":1" -e "L 9" -e "A -"
Output is
          1-2-3-4-5-6-7-8-9-0
-     
+

Hyphen is inserted after every 1 byte long block,but not after 9'th block.
-

`bbe -s -b "/First line/:/Last line/" /tmp/text'
Print lines between sentences `First line' and `Last line'.
+
bbe -s -b "/First line/:/Last line/" /tmp/text
Print lines between sentences ‘First line’ and ‘Last line’.
-
`bbe -s -b "%<a %:%</a>%" -e "s/\x0a/ /" -e "A \n" ./index.html'
Extract all links from ./index.html. To get one link per line, +
bbe -s -b "%<a %:%</a>%" -e "s/\x0a/ /" -e "A \n" ./index.html
Extract all links from ./index.html. To get one link per line, all newlines are converted to spaces and newline is added after every link.
-
`bbe -b "/\x5f\x28\x02/:10" -s -e "F d" -e "p h" -e "A \n" ./bindata'
10 bytes long sequences starting with values x5f x28 and x02 are printed as hex values. +
bbe -b "/\x5f\x28\x02/:10" -s -e "F d" -e "p h" -e "A \n" ./bindata
10 bytes long sequences starting with values x5f x28 and x02 are printed as hex values. Also the file offset is printed before each sequence and new line is added after every sequence. Example output:
          52688:x5f x28 x02 x32 x36 x5f x81 x64 x01 x93
           68898:x5f x28 x02 x39 x46 x5f x81 x64 x41 x05
           69194:x5f x28 x02 x42 x36 x5f x81 x64 x41 x05
-     
+


-

`bbe -b "/Linux/:5" -s -e "N;D;A \x0a" /bin/* | uniq'
Print the file names of those programs in /bin directory which contains word `Linux'. +
bbe -b "/Linux/:5" -s -e "N;D;A \x0a" /bin/* | uniq
Print the file names of those programs in /bin directory which contains word ‘Linux’. Example output:
          /bin/loadkeys:
           /bin/mkbimage:
           /bin/ps:
           /bin/uname:
-     
+


-

`bbe -b "/\x5f\x81\x18\x06/:10" -s -e "B d;d 0 4;c BCD ASC;A \n" ./bindata'
Print BCD numbers and their block numbers in ascii format. Numbers start with sequence x5f x81 x18 x06. +
bbe -b "/\x5f\x81\x18\x06/:10" -s -e "B d;d 0 4;c BCD ASC;A \n" ./bindata
Print BCD numbers and their block numbers in ascii format. Numbers start with sequence x5f x81 x18 x06. The start sequence is not printed.
-
`bbe -b "/\x5f/:2" -e "j 1;& \xf0" -o newdata bindata'
The least significant nybble of bytes after x5f is cleared.
+
bbe -b "/\x5f/:2" -e "j 1;& \xf0" -o newdata bindata
The least significant nybble of bytes after x5f is cleared.
-
`bbe -b "/\xff\xd8\xff/:/\xff\xd9/" -s -e "w pic%02B.jpg" -o /dev/null manual.pdf'
Extract jpg-images from pdf-file to separate jpg-files (assuming that the jpg start/stop sequences +
bbe -b "/\xff\xd8\xff/:/\xff\xd9/" -s -e "w pic%02B.jpg" -o /dev/null manual.pdf
Extract jpg-images from pdf-file to separate jpg-files (assuming that the jpg start/stop sequences does not appear in other context than jpg-images). Files will be named as pic01.jpg, pic02.jpg, pic03.jpg,...
-
`bbe -b "_<body>_:_</body>_" -s -o temp nicebody.html'
`bbe -b "_<body>_:_</body>_" -e "D;< temp" -o tmpindex.html index.html'
`mv tmpindex.html index.html'
The body part of the html-document index.html is replaced by the body of the document nicebody.html. +
bbe -b "_<body>_:_</body>_" -s -o temp nicebody.html
bbe -b "_<body>_:_</body>_" -e "D;< temp" -o tmpindex.html index.html
mv tmpindex.html index.html
The body part of the html-document index.html is replaced by the body of the document nicebody.html.
-


+


Previous: bbe programs, Up: Top @@ -522,7 +522,7 @@

If you find a bug in bbe, please send electronic mail to tjsa@iki.fi. Include the version number, which you can find by -running `bbe --version'. Also include in your message the +running ‘bbe --version. Also include in your message the output that the program produced and the output you expected.

If you have other questions, comments or suggestions about