18 lines
415 B
Bash
18 lines
415 B
Bash
|
#!/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
|