I need to convert a number from hexadecimal form to decimal form using shell script
for example :
convert()
{
...
echo x=$decimal
}
result :
convert "0x148FA1"
x=1347489
How to do it?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can convert in many different ways, all within bash, and relatively easy.
To convert a number from hexadecimal to decimal: