Skip to content

Instantly share code, notes, and snippets.

@levigroker
Last active May 25, 2021 20:35
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save levigroker/193ba909e2354de870513eec46c08222 to your computer and use it in GitHub Desktop.
Save levigroker/193ba909e2354de870513eec46c08222 to your computer and use it in GitHub Desktop.
A BBEdit Text Filter script to take textual input and produce hedidecimal array values of the same.
#!/bin/bash
#
# ASCII to Hex
# https://gist.github.com/levigroker/193ba909e2354de870513eec46c08222
#
# A BBEdit Text Filter script to take textual input and produce hedidecimal array values of the same.
# See http://bbeditextras.org/wiki/index.php?title=Text_Filters
# Levi Brown
# levigroker@gmail.com
# December 8, 2016
##
IN=$(tee)
HEX=$(echo -n "$IN" | xxd -c 256 -i | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
echo -n "${HEX}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment