@@ -23,11 +23,11 @@ use constant EX_FAILURE => 1;
2323use constant LINESZ => 16;
2424use constant PRINTMAX => 126;
2525
26- use vars qw/ $opt_A $opt_a $opt_B $opt_b $opt_c $opt_d $opt_e $opt_F $opt_f
27- $opt_H $opt_h $opt_i $opt_j $opt_l $opt_N $opt_O $opt_o $opt_s $opt_t
28- $opt_v $opt_X $opt_x / ;
26+ use vars qw/ $opt_A $opt_a $opt_B $opt_b $opt_c $opt_D $ opt_d $opt_e $opt_F
27+ $opt_f $ opt_H $opt_h $opt_i $opt_j $opt_l $opt_N $opt_O $opt_o $opt_s
28+ $opt_t $ opt_v $opt_X $opt_x / ;
2929
30- our $VERSION = ' 1.3 ' ;
30+ our $VERSION = ' 1.4 ' ;
3131
3232my ($offset1 , $radix , $data , @arr , $lim );
3333my ($lastline , $strfmt , $ml );
@@ -87,7 +87,7 @@ $lastline = '';
8787
8888my $Program = basename($0 );
8989
90- getopts(' A:aBbcdeFfHhij :lN:Oost:vXx' ) or help();
90+ getopts(' A:aBbcDdeFfHhij :lN:Oost:vXx' ) or help();
9191if (defined $opt_A ) {
9292 if ($opt_A !~ m /\A [doxn] \z / ) {
9393 warn " $Program : unexpected radix: '$opt_A '\n " ;
@@ -125,6 +125,9 @@ elsif ($opt_b) {
125125elsif ($opt_c ) {
126126 $fmt = \&char1;
127127}
128+ elsif ($opt_D ) {
129+ $fmt = \&udecimal4;
130+ }
128131elsif ($opt_d ) {
129132 $fmt = \&udecimal2;
130133}
@@ -452,7 +455,7 @@ sub diffdata {
452455}
453456
454457sub help {
455- print " usage: od [-aBbcdeFfHhilOosXxv ] [-A radix] [-j skip_bytes] " ,
458+ print " usage: od [-aBbcDdeFfHhilOosXxv ] [-A radix] [-j skip_bytes] " ,
456459 " [-N limit_bytes] [-t type] [file]...\n " ;
457460 exit EX_FAILURE;
458461}
@@ -464,7 +467,7 @@ od - dump files in octal and other formats
464467
465468=head1 SYNOPSIS
466469
467- B<od > [ I<-aBbcdeFfHhilOosXxv > ] [I<-j skip_bytes > ] [I<-N limit_bytes > ]
470+ B<od > [ I<-aBbcDdeFfHhilOosXxv > ] [I<-j skip_bytes > ] [I<-N limit_bytes > ]
468471 [ I<-A radix > ] [ I<-t type > ] [ F<file> ... ]
469472
470473=head1 DESCRIPTION
@@ -503,6 +506,10 @@ Single-byte octal display.
503506
504507Display characters literally, with non-printable characters displayed as C escape sequences.
505508
509+ =item -D
510+
511+ Four-byte unsigned decimal display.
512+
506513=item -d
507514
508515Two-byte unsigned decimal display.
0 commit comments