I want to convert a decimal number (loop index number) in a bash script to hexadecimal to be used by another command. Something like:
for ((i=1; i<=100; i++))
do
a=convert-to-decimal($i)
echo "$a"
done
Where a should be hexadecimal with four digits and hex identifier. For example if value of i is 100, the value of a should be 0x0064. How to do it?