Last Updated: February 25, 2016
·
530
· techlivezheng

Fastest way to convert a number in other base to decimal number in Linux

Use Bash's arithmetic expression and expansion echo $((<BASE>#<NUM in that BASE>))` can quicikly convert any number in other base to a decimal number.

For example

echo $((2#101010)) will give 42
echo $((16#AAAA)) will give 43690