How can hex numbers be converted to decimal numbers in a shell? This is so wrong for some reason:
echo "obase=16 ;3C9D" |bc
How can hex numbers be converted to decimal numbers in a shell? This is so wrong for some reason:
echo "obase=16 ;3C9D" |bc
bb=0xa aa=`printf "%d" $bb` echo $aa
Reprinted:
10
printf "%d" $a
; echo $ aa bash: printf: 3C9D: invalid number 3 - e_kliminecho $((0xa))
- alexlza=$((0xb)); echo $a
a=$((0xb)); echo $a
- alexlzSource: https://ru.stackoverflow.com/questions/73433/
All Articles