Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function dec2bin() {
- num=$1
- bin=""
- while [ $num != 0 ] ; do
- resto=$((num % 2))
- bin="${bin}${resto}"
- num=$((num / 2))
- done
- echo $bin | rev
- }
- dec2bin $1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement