I am trying to convert hex to decimal to ascii and store it in a variable. I am using the following code.
HEX=30
DEC=`printf "%d\n" 0x${HEX}`
echo "$DEC"
ASC=`printf \\$(printf '%03o' $DEC)`
echo "$ASC"
I am getting the following error syntax error :
`(' unexpected
I am using Solaris 10, and ksh
. I do not want to use a function for ascii and call it to store the value. I want to be able to do it without using a function.