[#] Konwerter hex2dec i dec2hex

( Ostatnio zmieniony wt., 17/06/2008 - 14:12 )
 

hex2dec.sh

#!/bin/sh

if [ "$#" -ne "1" ]; then
   echo "Usage: $(basename $0) value" && exit 1
fi

echo "obase=10;ibase=16; ${1}" | bc

exit 0

dec2hex.sh

#!/bin/sh

if [ "$#" -ne "1" ]; then
   echo "Usage: $(basename $0) value" && exit 1
fi

echo "obase=16;ibase=10; ${1}" | bc

exit 0
5
Twoja ocena: Brak Średnio: 5 (1 vote)