My question: is it just an overlooking, or is the lack of this feature
deliberate?
I think it'd be a reasonable feature to add, if someone took the time
to compose a complete patch for it. (Documentation is often the
hardest part.)
I've toyed a bit with the source of od, and the following patch is what I
came up with. It should be complete -- the changes are documented in
Texinfo, --help and ChangeLog (albeit not in .po's -- I'm not much of a
polyglot :-))
The patch works for me on Slackware 10.1. Feedback and tests would be
greatly appreciated.
Sincerely,
Daniel Janus
----- CUT HERE -----
Index: ChangeLog
===================================================================
RCS file: /cvsroot/coreutils/coreutils/ChangeLog,v
retrieving revision 1.1314
diff -u -r1.1314 ChangeLog
--- ChangeLog 2 Jun 2005 10:04:32 -0000 1.1314
+++ ChangeLog 3 Jun 2005 05:13:49 -0000
@@ -1,3 +1,12 @@
+2005-06-03 Daniel Janus <address@hidden>
+
+ * NEWS: od now supports binary dumping with "-t b".
+ * src/od.c (print_binary_char, print_binary_short, print_binary_int,
+ print_binary_long, print_binary_long_long): New functions.
+ (decode_one_format): Support for "-t b".
+ (usage): Modified to reflect the new feature.
+ * doc/coreutils.texi (od invocation): Documented.
+
2005-06-02 Jim Meyering <address@hidden>
* Version 5.3.1.
Index: doc/coreutils.texi
===================================================================
RCS file: /cvsroot/coreutils/coreutils/doc/coreutils.texi,v
retrieving revision 1.259
diff -u -r1.259 coreutils.texi
--- doc/coreutils.texi 2 Jun 2005 05:00:24 -0000 1.259
+++ doc/coreutils.texi 3 Jun 2005 05:14:27 -0000
@@ -1643,6 +1643,8 @@
@table @samp
@item a
named character
address@hidden b
+binary
@item c
@acronym{ASCII} character or backslash escape,
@item d
@@ -1667,8 +1669,8 @@
by following the type indicator character with a decimal integer.
Alternately, you can specify the size of one of the C compiler's
built-in data types by following the type indicator character with
-one of the following characters. For integers (@samp{d}, @samp{o},
address@hidden, @samp{x}):
+one of the following characters. For integers (@samp{b}, @samp{d},
address@hidden, @samp{u}, @samp{x}):