Google Search

Tuesday, November 3, 2015

Shell Program to convert from anybase to anybase

echo "enter input base:"
read i
echo "enter output base:"
read o
echo "enter number"
read n
n=`echo $n|tr '[a-z]' '[A-Z]'`
echo "ibase=$i">tmp1
echo $n>>tmp1
x=`bc < tmp1`;
echo "obase=$o">tmp2
echo $x>>tmp2
y=`bc < tmp2`;
echo "$n with input base $i is changed to $y with output base $o"
rm tmp1
rm tmp2

No comments:

Post a Comment