#!/bin/sh
# Take a list of one line messages and output format for
# message file. Use only for static structures because
# position depencency is required. Otherwise make message
# id's more informative for use (i.e. hand edit)
# I used this for _errlist.c, _siglist.c.  - Mitch
# Its not as clever as I'd like it to be :-(

# NOTE: Gawk-2.15.3 broke the RLENGTH return from match().
# So please use the lex version of this called `xtract'. Just type
# 	% make xtract 
# in this directory.

gawk '(/\".*\"/) && ($1 !~ /#/) { \
		match($0,/\".*\"/);
		str = substr($0,RSTART+1,RLENGTH-2); \
		if (str)
		printf("$ #%d Original Message:(%s)\n# %s\n",x++,str,str)}' "$*"

