#! /bin/ksh
print Conversion Structure:
if [[ -z $1 || $1 == [a-zA-Z]* || $# > 1 ]]
then
cat <
cn 2#number for binary style
cn 16#number for hex style
cn number for stand style
info
exit
fi
integer -i10 value=$1
print "Decimal Structure : t $value"D""
typeset -i16 value
print "Hexadecimal Structure : t $value"H""|sed 's/16#//'
typeset -i2 value
v2=$(print $value|sed 's/2#//')
integer len=${#v2}
((n=8-$len))
v=$(echo $(perl -e "print 0 x $n")$v2)
No comments:
Post a Comment