xref: /freebsd/contrib/netbsd-tests/lib/libppath/plist_to_c (revision 9268022b74279434ed6300244e3f977e56a8ceb5)
1#!/bin/sh
2
3prog=$(basename $0)
4usage()
5{
6	echo "usage: ${prog} symbol" 1>&2
7	exit 1
8}
9
10if [ $# -ne 1 ]; then
11	usage
12fi
13
14sed 's/\(["\]\)/\\\1/g' | \
15${AWK:-awk} -v sym=$1 '
16BEGIN	{ printf "const char " sym "[] = \""; }
17	{ printf $0 "\\n"; }
18END	{ print "\";"; }'
19
20exit 0
21