[BACK]Return to mkdict.sh CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / texi2mdoc / afl

File: [cvsweb.bsd.lv] / texi2mdoc / afl / mkdict.sh (download)

Revision 1.3, Sat Feb 28 00:03:21 2015 UTC (9 years, 1 month ago) by kristaps
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +2 -1 lines

Prevent infinite macro expansion by incrementing a "depth" of recursive
expansion IFF we're currently in a macro expansion already, where the start
of the macro expansion begins at the macro name and NOT after the name has
been parsed.

#! /bin/sh

rm -rf dict
mkdir dict

sed -n '/TEXICMD__BEGIN/,/TEXICMD__END/p' ../main.c | \
	tail -n +2 | \
	sed '$d' | \
	awk '{print $3}' | \
	sed -e 's!^\"!!' -e 's!\",$!!' | \
	while read ln ; do [ ${#ln} -gt 1 ] && printf "$ln" >"dict/$ln" ; done