Tyleo-Dev-ShellScripting-Ol.../SH_PROJECTS/decimaltobinary.sh

18 lines
415 B
Bash
Raw Permalink Normal View History

2024-02-18 21:29:57 +00:00
#!/usr/bin/env bash
# This script translate decimal read values to binary one.
number=0
printf '
-------------------------------
DECIMAL TO BINARY CONVERTER
-------------------------------
This script will translate your
decimal number to binary one.
Using bc command
(need to be present on your system to work)
'
echo -n "Enter your value : "
read number
echo "Converting!"
sleep 1
echo "obase=2;$number" | bc