RosettaCodeData/Task/Binary-digits/UNIX-Shell/binary-digits.sh
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

9 lines
201 B
Bash

# Define a function to output binary digits
tobinary() {
# We use the bench calculator for our conversion
echo "obase=2;$1"|bc
}
# Call the function with each of our values
tobinary 5
tobinary 50