Quick decimal to hex conversion with BASH
An easy way to make a decimal to hex conversion is using the printf bash command. To convert decimal to hex:
$ num=64 $ printf '%x\n' $num 40
If you want the result to be uppercase replace %x with %X
$ num=255 $ printf '%X\n' $num FF
0 comments
