[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Problems with dd and the keywords swab and sync



Both the swab and the sync keywords fail to work correctly according to
SUS, but the behavior is one I would classify as "broken", so I'm reticent
to code this broken behavior into the spec as "differences".

The SUS says that swab should "ignore" any odd characters, but:

dd if=swab.txt of=swab.swab conv=swab

creates the output file swab.swab that looks like:

bababa
a

from the swab.txt file containing:

abababa

>From the SUS I would expect:

bababa

as the only output.


As to "sync", the problem comes when you specify the block option. SUS
says that nulls are replaced by blanks when the block option is also
specified. The Linux manpage for dd doesn't mention this issue at all, and
the output under these circumstances is mixed.

In my text case, there was a short line and a long line. The short line is
expected to be blank filled and the long line is expected to be truncated.
The output file does add blanks to padd the short line, and it does
truncate the long line, but then it adds a record of nulls padded with 7
blanks to the record size. I have no idea where this additional record
came from, and it certainly looks like broken behavior.

Do I have to put these items into the spec as "differences" or is there
some more appropriate label I can put on these issues?

Waiting is,

Dwarf
--
_-_-_-_-_-   Author of "Dwarf's Guide to Debian GNU/Linux"  _-_-_-_-_-_-
_-                                                                    _-
_- aka   Dale Scheetz                   Phone:   1 (850) 656-9769     _-
_-       Flexible Software              11000 McCrackin Road          _-
_-       e-mail:  dwarf@polaris.net     Tallahassee, FL  32308        _-
_-                                                                    _-
_-_-_-_-_-  Released under the GNU Free Documentation License   _-_-_-_-
              available at: http://www.polaris.net/~dwarf/



Reply to: