Skip to content

Instantly share code, notes, and snippets.

@iwadon
Created March 8, 2011 18:10
Show Gist options
  • Select an option

  • Save iwadon/860677 to your computer and use it in GitHub Desktop.

Select an option

Save iwadon/860677 to your computer and use it in GitHub Desktop.
diff --git a/src/inline.sh b/src/inline.sh
index 5ea082d..5acc17b 100755
--- a/src/inline.sh
+++ b/src/inline.sh
@@ -20,6 +20,6 @@
varname="$1"
echo "const char $varname[] ="
-od -t x1 -A n -v | sed -e 's| |\\x|g; s|^|"|; s|$|"|'
+od -t x1 -A n -v | sed -e 's| ||g; s|..|\\x&|g; s|^|"|; s|$|"|'
echo ";"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment