I found a bit of code here that can be used to convert bases in bash neatly. How do I use it and get the result into a bash variable?
I tried something like below, but it did not work.
NUM_IN_DEC=12321
BASE36=($(echo {0..9} {a..z}))
NAME=(
for i in $(bc <<< "obase=36; $NUM_IN_DEC"); do
echo -n ${BASE36[$(( 10#$i ))]};
done && echo
)
echo converted value is $NAME