medit/moo/mooutils/py2h.sh

12 lines
236 B
Bash
Raw Normal View History

2005-11-06 08:46:13 +00:00
if [ x$2 = x ]; then
echo usage: "$0 <var_name> <file_name>"
exit 1
fi
2005-11-08 03:57:40 +00:00
VARNAME=$1
INPUT=$2
2006-05-14 18:45:37 -05:00
echo "static const char $VARNAME [] = \"\""
2005-11-08 05:01:42 +00:00
sed 's/\\/\\\\/g' $INPUT | sed 's/"/\\"/g' | sed 's/^\(.*\)$/"\1\\n"/' || exit $?
2005-11-06 08:46:13 +00:00
echo ";"