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

Re: Problems with dd and the keywords swab and sync



On Wed, 18 Apr 2001, Matthew Woodcraft wrote:

> This is what I get:
> 
> ~/tmp% echo abababa > swab.txt              
> ~/tmp% dd if=swab.txt of=swab.swab conv=swab
> 0+1 records in
> 0+1 records out
> ~/tmp% cat swab.swab
> bababa
> ~/tmp% dd --version 
> dd (GNU fileutils) 4.0l
> Written by Paul Rubin, David MacKenzie, and Stuart Kemp.
> 
> Copyright (C) 1999 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

dwarf:~# dd --version
dd (fileutils) 4.0.37
Written by Paul Rubin, David MacKenzie, and Stuart Kemp.

Copyright (C) 2000 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

we seem to have diffent versions...
> 
> 
> It looks to me like your result is just because dd is swapping a
> newline at the end of the file.
> 
No, it looks like dd is taking the "left over a" and dumping it to sysout
when the "conversion" is complete. This isn't even close to "ignore".

A different way to the same results (for my version only...)

dwarf:~# dd conv=swab
ababababa   #this line is my input to stdin followed by <cntrlD>
babababa
a0+1 records in  #Note the extra "a" at the beginning of this output line
0+1 records out
dwarf:~#

Seems this version has a bug ;-)

Thanks for the feedback,

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: