xref: /freebsd/contrib/netbsd-tests/lib/libppath/plist_to_c (revision f4b37ed0f8b307b1f3f0f630ca725d68f1dff30d)
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