Bash shell script to convert Decimal to Hexadecimal and Octal
codeaft.sh
#!/bin/bash

echo "———————————————————————————————————————————"
echo "Script to convert Dec To Hex and Oct number"
echo "———————————————————————————————————————————"
a=65535
echo -n "Decimal="$a
printf "\nOctal="%o $a
printf "\nHexadecimal="%x $a
echo -e "\n———————————————————————————————————————————"
Output
codeaft@codeaft:~$ bash codeaft.sh
———————————————————————————————————————————
Script to convert Dec To Hex and Oct number
———————————————————————————————————————————
Decimal=65535
Octal=177777
Hexadecimal=ffff
———————————————————————————————————————————
codeaft@codeaft:~$ 
Comments and Reactions