The gawk command in Red Hat Enterprise Linux 4 may not convert hexadecimal values properly

Solution Verified - Updated -

Issue

  • gawk 3.1.3 functionality incorrect
  • Passing hexadecimal values through the "-v" option to gawk may generate incorrect results.  For example:
    echo 0xABCDEF | awk -vVAL="0x1234" '{value=VAL; print strtonum(value); value=$1; print strtonum(value); }'
    0
    11259375
    

    The first value ("0") is incorrect.

Environment

  • Red Hat Enterprise Linux 4
  • gawk-3.1.3-10.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.