bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] print statement problem with hexadecimal escape sequence


From: Hyunho Cho
Subject: [bug-gawk] print statement problem with hexadecimal escape sequence
Date: Thu, 03 May 2018 09:15:43 +0900


There is a erroneous print result with "\xHH" escape sequence that is 
immediately followed by hexadecimal value (0-9a-f)

$ gawk --version
GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.6, GNU MP 6.1.2)
Copyright (C) 1989, 1991-2016 Free Software Foundation.


# there is no problem because "K" is not hex character.

$awk 'BEGIN { print "\x41\x42\x43KKK" }'  | od -a 
0000000   A   B   C   K   K   K  nl
0000007

# There is a problem because "F" is hex character that immediately follwing 
"\xHH" escape sequence.

$ awk 'BEGIN { print "\x41\x42\x43FFF" }'  | od -a
0000000   A   B del  nl
0000004

# if i insert a space in front of "F" then problem disappear.

$ awk 'BEGIN { print "\x41\x42\x43 FFF" }' | od -a
0000000   A   B   C  sp   F   F   F  nl
0000010


reply via email to

[Prev in Thread] Current Thread [Next in Thread]