need script to convert number in hexadecimal

hi ,
i need a script to convert number into hexadecimal base
for example: 237=>ED
it s very important for me thank you in advance for you help

see man od

echo 'obase=16;237'| bc
is one solution. ksh has built-in support for base arithmetic. It's not as conveinent, but it is very fast for scripting.
i=237
typeset -i16 i
echo $i

Hi,

I would like to build on this example. How would I take the value from that hexadecimal conversion and store it in a variable. For example, I have a script that does the following:

echo "Please enter how many cycles you would like to run :\c"
read cycles
let input=$cycles/8
echo $input

I would like to convert "$input" to a hexadecimal value, then store it in a new variable so I can use the hex converted value in my program. Any pointers on how to do that? Thanks in advance

printf "%x" $input | read newvariable
# or
newvariable=$(printf "%x" $input)

newvariable contains the hex value of the input variable.

Thanks Jim,

much appreciated