In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it\'s not realizing I\'m feeding it ASCII represent
In zsh you can do this sort of thing:
zsh
% typeset -i 16 y % print $(( [#8] x = 32, y = 32 )) 8#40 % print $x $y 8#40 16#20 % setopt c_bases % print $y 0x20
Example taken from zsh docs page about Arithmetic Evaluation.
I believe Bash has similar capabilities.