Skip to content

Instantly share code, notes, and snippets.

@elderica
Created August 5, 2023 04:29
Show Gist options
  • Save elderica/e2a2fb012e50f23af742bb1874d472eb to your computer and use it in GitHub Desktop.
Save elderica/e2a2fb012e50f23af742bb1874d472eb to your computer and use it in GitHub Desktop.
awkbin
#!/bin/sh
export LANG=C LC_ALL=C
LF=$(printf '\\\n_'); LF=${LF%_}
od -A n -t x1 -v |
tr -Cd '0123456789accdefABCDEF\n' |
tr 'abcdef' 'ABCDEF' |
sed "s/../&$LF/g" |
grep -v '^$'
#!/bin/sh
export LANG=C LC_ALL=C
awk '
BEGIN {
MAXLENFMTSTR = 2048 - length("printf ");
for (i=1; i<256; i++) {
fmt[i] = sprintf
#!/bin/sh
export LANG=C LC_ALL=C
bcrc=$(mktemp)
echo 'obase=10;ibase=16;' >$bcrc
tr 'abcdef' 'ABCDEF' |
bc $bcrc
rm $bcrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment