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

Re: Problems with dd and the keywords swab and sync



In article <[🔎] Pine.LNX.3.96.1010418112559.374h-100000@dwarf> you write:
>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.

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.


It looks to me like your result is just because dd is swapping a
newline at the end of the file.

-M-



Reply to: