[Bug 1842908] [NEW] hexdump `_u` conversion outputs ambiguous string.

agc 1842908 at bugs.launchpad.net
Thu Sep 5 10:21:54 UTC 2019


Public bug reported:

Output hex codes for 12 and 255, then convert it to binary, and dump
these using hexdump's '_u' conversion string, (_u means output US ASCII
characters):

    printf '%.2x\n' 12 255 | xxd -r -p | hexdump  -v   -e '/1 "
_%_u\_\n"'

Output:

     _ff_
     _ff_

Expected result would be two different strings, (maybe "FF" for the
first one?), or failing that, to document this ambiguity in 'man
hexdump'.

Note that some format strings like '_p' are quite non-specific, and
output all non-printing chars as a '.', and that's to be expected.  But
for '_u' this is not expected, and the above is the only instance of
ambiguous output, as shown by:

    printf '%.2x\n' {0..255} | xxd -r -p | \
    hexdump  -v   -e '/1 " _%_u\_\n"' | \
    sort | uniq -c | sort -nr | head -2

Output (i.e. the only duplicate is 'ff'):

      2  _ff_
      1  _Z_

Hope this helps...

** Affects: bsdmainutils (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bsdmainutils in Ubuntu.
https://bugs.launchpad.net/bugs/1842908

Title:
  hexdump `_u` conversion outputs ambiguous string.

Status in bsdmainutils package in Ubuntu:
  New

Bug description:
  Output hex codes for 12 and 255, then convert it to binary, and dump
  these using hexdump's '_u' conversion string, (_u means output US
  ASCII characters):

      printf '%.2x\n' 12 255 | xxd -r -p | hexdump  -v   -e '/1 "
  _%_u\_\n"'

  Output:

       _ff_
       _ff_

  Expected result would be two different strings, (maybe "FF" for the
  first one?), or failing that, to document this ambiguity in 'man
  hexdump'.

  Note that some format strings like '_p' are quite non-specific, and
  output all non-printing chars as a '.', and that's to be expected.
  But for '_u' this is not expected, and the above is the only instance
  of ambiguous output, as shown by:

      printf '%.2x\n' {0..255} | xxd -r -p | \
      hexdump  -v   -e '/1 " _%_u\_\n"' | \
      sort | uniq -c | sort -nr | head -2

  Output (i.e. the only duplicate is 'ff'):

        2  _ff_
        1  _Z_

  Hope this helps...

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bsdmainutils/+bug/1842908/+subscriptions



More information about the foundations-bugs mailing list