Skip to main content

All Questions

Tagged with
1 vote
2 answers
1k views

Unable to store ascii value in a variable

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 "$...
ayrton_senna's user avatar
  • 1,091