summaryrefslogtreecommitdiffstats
path: root/doc/bbe.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/bbe.texi')
-rw-r--r--doc/bbe.texi27
1 files changed, 17 insertions, 10 deletions
diff --git a/doc/bbe.texi b/doc/bbe.texi
index d555db8..00f3f74 100644
--- a/doc/bbe.texi
+++ b/doc/bbe.texi
@@ -6,7 +6,7 @@
@finalout
@c %**end of header
-@set VERSION 0.1.4
+@set VERSION 0.1.5
@copying
This file documents the @command{bbe} - binary block editor
@@ -68,7 +68,7 @@ The @command{bbe} program is a sed-like editor for binary files. @command{bbe}
performs basic byte related transformations on blocks of input stream. @command{bbe} is non-interactive command line tool and
can be used as a part of a pipeline. @command{bbe} makes only one pass over input stream.
-@command{bbe} also contains grep-like features, like printing the filename, offset and block number.
+@command{bbe} contains also grep-like features, like printing the filename, offset and block number.
@node Samples, Invoking bbe, Overview, Top
@@ -168,8 +168,7 @@ successfully.
Print the version number of @command{bbe} and then exit successfully.
@end table
-All remaining options are names of input files, if no input files are specified, then the standard input is read.
-@code{-} means standard input.
+All remaining options are names of input files, if no input files are specified or @code{-} is given, then the standard input is read.
@node Block, Commands, Invocation, Invoking bbe
@section Block definition
@@ -242,7 +241,7 @@ Also escape code @code{\y} can be used. Decimal values of @code{\y}'s:
13
@item \;
-59@*Semicolon must be escaped, because it is command delimitter.
+59@*Semicolon must be escaped, because it is a command delimitter.
@end table
@@ -291,7 +290,7 @@ Commands appearing after this command have no effect after @var{N} blocks are fo
@strong{Note}: Commands that are defined before this command have effect on every block.
@item N
-Before block contents the file name where the block starts is printed with colon.
+Before block contents the file name where the current block starts is printed with colon.
@item F @var{f}
Before block contents the current stream offset and colon is printed in format specified by @var{f}.
@@ -309,7 +308,7 @@ Octal.
@item B @var{f}
Before block contents the current block number and colon is printed in format specified by @var{f}.
-Block numbering starts at zero. @var{f} can have one of the sames codes as @code{F}-command
+Block numbering starts at one. @var{f} can have one of the sames codes as @code{F}-command
@end table
@subheading Byte commands are:
@@ -371,7 +370,10 @@ character not present in @var{search} or @var{replace}.
@item w @file{file}
Contents of blocks are written to file @file{file}. @strong{Note}: Data inserted by commands @code{A} and @code{I}
-are not written to file @file{file} and @code{J} and @code{L} commands have no effect on @code{w}-commands.
+are written to file @file{file} and @code{j} and @code{l} commands have no effect on @code{w}-commands. Zero size files are not preserved.@*
+Filename can contain format string @code{%B} or @code{%nB}, these format strings are replace by current block number (starting from one), causing every block to have it's own file.
+In @code{%nB}, the @code{n} is field width in range 0-99. If @code{n} has a leading zero, then the block numbers will be left padded with zeroes.
+
@item y/@var{source}/@var{dest}/
Translate bytes in @var{source} to the corresponding bytes in @var{dest}. @var{source} and @var{dest} must have equal length.
@@ -482,7 +484,7 @@ Output is
@example
1-2-3-4-5-6-7-8-9-0
@end example
-Minus is inserted after every 1 byte long block,but not after 9'th block.@*
+Hyphen is inserted after every 1 byte long block,but not after 9'th block.@*
@item bbe -s -b "/First line/:/Last line/" /tmp/text
Print lines between sentences @samp{First line} and @samp{Last line}.@*
@@ -518,7 +520,12 @@ Print BCD numbers and their block numbers in ascii format. Numbers start with se
The start sequence is not printed.@*
@item bbe -b "/\x5f/:2" -e "j 1;& \xf0" -o newdata bindata
-The least significant nybble of bytes after @code{x5f} is cleared.
+The least significant nybble of bytes after @code{x5f} is cleared.@*
+
+@item 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 @file{pic01.jpg}, @file{pic02.jpg}, @file{pic03.jpg},...
@end table
OpenPOWER on IntegriCloud