Incrementing by one in hex is the same as incrementing by one in any other number base
My suggestion: Do the increment like normal, and manually convert to hex format when you need to display or compare it to a hex value.
For instance:
Code:
#!/bin/bash
for number in $( seq 1 255 )
do
hex_representation=$( printf "%X" ${number} )
echo "${number}: ${hex_representation}"
done
If you're script is given the value of the number to increment in hex notation, you can also use printf to convert it to decimal for you:
Code:
number=$( printf "%d" 0x${hex_representation}" )
I'm not claiming that any of this is efficient by any means. Nor am I saying it will solve all your problems
But it should give you a start.