Put this function in your .bashrc (or wherever):
bin2hex() {
echo "obase=16;ibase=2;$1"|bc
}
Remember to install
bc
if you don’t have it already.
# bin2hex 10011111
9F
Put this function in your .bashrc (or wherever):
bin2hex() {
echo "obase=16;ibase=2;$1"|bc
}
Remember to install
bc
if you don’t have it already.
# bin2hex 10011111
9F
I needed exactly this for a task at work. Your efforts do not go unnoticed!