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