How to Print an ASCII Character by Different Code Points in Bash

asciibashshell

In the ASCII table the 'J' character exists which has code points in different numeral systems:

Oct   Dec   Hex   Char
112   74    4A    J

It's possible to print this char by an octal code point by printing
printf '\112' or echo $'\112'. How do I print the same character by decimal and hexadecimal code point presentations?

Best Answer

Hex:

printf '\x4a'

Dec:

printf "\\$(printf %o 74)"

Alternative for hex :-)

xxd -r <<<'0 4a'
Related Question