Hexadecimal To Decimal in Shell Script

前端 未结 8 2274
北恋
北恋 2020-11-29 15:34

Can someone help me to convert a hexadecimal number to decimal number in a shell script?

E.g., I want to convert the hexadecimal number bfca3000 to deci

8条回答
  •  感情败类
    2020-11-29 16:12

    In dash and other shells, you can use

    printf "%d\n" (your hexadecimal number)
    

    to convert a hexadecimal number to decimal. This is not bash, or ksh, specific.

提交回复
热议问题