Maybe stating the obvious, but bash's printf builtin can do base 8 and 16:
$ printf '%o\n' 1234
2322
$ printf '%#o\n' 1234
02322
$ printf '%x\n' 1234
4d2
$ printf '%#x\n' 1234
0x4d2
$ printf '%X\n' 1234
4D2
$ printf '%#X\n' 1234
0X4D2
Even hexadecimal floats:
$ LC_ALL=C printf '%a\n' 1234.56
0x9.a51eb851eb851ecp+7
$ LC_ALL=C printf '%A\n' 1234.56
0X9.A51EB851EB851ECP+7
(here using LC_ALL=C to make sure the decimal radix character is .)
But it doesn't do other bases for which you'd need more advanced shells such as zsh or ksh93 or do it by hand.
To store the result in a variable:
printf -v oct %o 1234
is more efficient than:
oct=$(printf %o 1234)
Which in bash (contrary to ksh93 or the sh of some BSDs) means forking a process and send the result through a pipe.
For those who're not stuck with bash, some alternatives with some other shells can be found at:
bcor (GNU)dc. Example conversion of number1234567890to base 26 assuminga= value 0,b= 1 etc.echo 26 o 1234567890 p | dc | awk '{ for(i=1; i<=NF; i++) printf("%c",$i+97) } END { printf("\n") }'12#for base 12 in front of the numbers. E.g.echo $(( 12#100 )) $(( 12#bb ))prints144 143. Not that it helps much.)