File: embed.sh

package info (click to toggle)
phoc 0.52.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,052 kB
  • sloc: ansic: 107,165; xml: 3,765; sh: 138; makefile: 33; javascript: 5
file content (11 lines) | stat: -rwxr-xr-x 161 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/sh -eu

var=${1:-data}
hex="$(od -A n -t x1 -v)"

echo "static const char $var[] = {"
for byte in $hex; do
	echo "	0x$byte,"
done
echo "	0x00,"
echo "};"