The behaviour of dd on OpenBSD 3.9 is noncompliant to it's own OpenBSD manpage:

OpenBSD:
[EMAIL PROTECTED]:~$ dd bs=1 skip=2 
1234
1234
5+0 records in
5+0 records out
5 bytes transferred in 1.764 secs (3 bytes/sec)

Linux:
[EMAIL PROTECTED] ~ $ dd bs=1 skip=2
1234
34
3+0 records in
3+0 records out
3 bytes (3 B) copied, 1.71841 seconds, 0.0 kB/s

Excerpt from OpenBSD dd manpage:

     skip=n   Skip n blocks from the beginning of the input before copying.
              On input which supports seeks, an lseek(2) operation is used.
              Otherwise, input data is read and discarded.  For pipes, the
              correct number of bytes is read.  For all other devices, the
              correct number of blocks is read without distinguishing between
              a partial or complete block being read.

     bs=n     Set both the input and output block size to n bytes, superseding
              the ibs and obs operands.  If no conversion values other than
              noerror, notrunc, or sync are specified, then each input block
              is copied to the output as a single block without any aggrega-
              tion of short blocks.

     if=file  Read input from file instead of the standard input.

     of=file  Write output to file instead of the standard output.  Any regu-
              lar output file is truncated unless the notrunc conversion value
              is specified.  If an initial portion of the output file is
              skipped (see the seek operand), the output file is truncated at
              that point.

STANDARDS
     The dd utility is expected to be a superset of the IEEE Std 1003.2
     (``POSIX.2'') standard.  The files operand and the ascii, ebcdic, ibm,
     oldascii, oldebcdic, and oldibm values are extensions to the POSIX stan-
     dard.

Does the POSIX specify the skip must work? If yes, then dd on OpenBSD 3.9 is
not POSIX compliant.

CL<

Reply via email to