Created
January 23, 2015 21:14
-
-
Save remram44/81746e17668c8a202f8c to your computer and use it in GitHub Desktop.
hexdump bugs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ echo hello | hexdump -v -e "\"\\x\" 1/1 \"%02X\"" | |
| x68x65x6Cx6Cx6Fx0A | |
| $ echo hello | hexdump -v -e "\"\\\\x\" 1/1 \"%02X\"" | |
| \\68\\65\\6C\\6C\\6F\\0A | |
| expected: \x68\x65\x6C\x6C\x6F\x0A | |
| $ echo hello | hexdump -v -e "1/1 \"\\x%02X\"" | |
| hexdump: %A: bad conversion character | |
| $ echo hello | hexdump -v -e "1/1 \"\\\\x%02X\"" | |
| hexdump: %A: bad conversion character |
Author
So the second one gives you only one backslash, but still no x... how broken is this!?
Author
Filed #776096 against Debian.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ceacy@canonne-laptop:
$ echo hello | hexdump -v -e ""\x" 1/1 "%02X""$ echo hello | hexdump -v -e ""\x" 1/1 "%02X""x68x65x6Cx6Cx6Fx0Aceacy@canonne-laptop:
\68\65\6C\6C\6F\0Aceacy@canonne-laptop:
$ echo hello | hexdump -v -e "1/1 "\x%02X""$ echo hello | hexdump -v -e "1/1 "\x%02X""hexdump: %A: bad conversion character
ceacy@canonne-laptop:
hexdump: %A: bad conversion character
ceacy@canonne-laptop:~$