hex2decimal shell script

I have a list of hex numbers that I want converted to decimal. It might have 500 lines in it or so... example

hexfile.txt
---
3EFF
32E1
A10B
10AB
.
.
.
.
12D1
---

can these values be converted with a shell script?

PS I think I want to donate....can I use paypal? Would it be an insult if it were just a few dollars? 5, 10? is there a minimum

One way:

$ cat hexfile.txt
3EFF
32E1
A10B
10AB
$
$
$ cat hexer
#! /usr/bin/ksh

exec < hexfile.txt

typeset -i10 dec
while read hex ; do
        ((dec=16#$hex))
        echo $hex $dec
done
exit 0
$
$
$ ./hexer
3EFF 16127
32E1 13025
A10B 41227
10AB 4267
$

Minimum donation is $5 and paypal handles the donations for us.

in bash

while read hexa
do 
   printf "%d\n"  "0x"$hexa
done < file

cool....I will definitely donate! at least a 5spot! hehe The answers i've got on here already have saved me alot of time and worth so much more so I feel bad. I guess every little bit counts though. i'm not one to just take take take though, so at least i'll give somethin back! :slight_smile: