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