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