Source

pythonwise / binary

1
2
3
4
5
6
7
8
9
#!/bin/bash
# Show binary representation of a number

if [ $# -ne 1 ]; then
    echo "usage: `basename $0` NUMBER" 1>&2
    exit 1
fi

echo "obase=2; $1" | bc -l