Skip to content

Instantly share code, notes, and snippets.

@levigroker
Last active May 25, 2021 20:35
Show Gist options
  • 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
# [email protected]
# 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