Skip to content

Instantly share code, notes, and snippets.

@Vftdan
Created April 8, 2020 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Vftdan/3bdcabaf1ea6e4a75abcec63687c0d80 to your computer and use it in GitHub Desktop.
Save Vftdan/3bdcabaf1ea6e4a75abcec63687c0d80 to your computer and use it in GitHub Desktop.
Like hexdump, but with base 2. Bit & byte order is little-endian.
#! /bin/sh
for i in $( (echo 'ibase=16;obase=2;'; hexdump -v -e '/1 "%02X\n"' $@) | bc); do \
printf '%08i\n' $i | rev
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment