Xref: utzoo comp.unix.wizards:13285 news.admin:4226 news.sysadmin:1880
Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ncar!ames!oliveb!3comvax!bridge2!mbt
From: mbt@bridge2.3Com.Com (Brad Turner)
Newsgroups: comp.unix.wizards,news.admin,news.sysadmin
Subject: Re: unshar business
Message-ID: <209@bridge2.3Com.Com>
Date: 8 Dec 88 15:50:22 GMT
References: <283@gsg.UUCP> <12273@cup.portal.com>
Reply-To: mbt@bridge2.3Com.com (Brad Turner)
Organization: 3Com Corp., Mt. View, CA
Lines: 48

In article <12273@cup.portal.com> John_-_DeBert@cup.portal.com writes:
>In article [283@gsg.UUCP] Cathy Segedy writes:
>
>>write (and test to my own satisfaction) a simple C program to do it instead.
>>      [stuff deleted]
>>This took considerably less time than reading the huge volume of news that
>>has been generated on the subject.
>>
>>					Cathy Segedy

Being really lazy I did the same thing about a year ago only I used lex and
a shell script.
This ain't a contest, but below is a sufficiently short lex program to
chop off the headers of map files as they are sent out.

----------------cut here-------guillotin.l------------------
%START A B
%%
	{BEGIN A;}
[^\000]		{}
"if "		{BEGIN B; printf("%s",yytext);}
"export "		{BEGIN B; printf("%s",yytext);}
"sed "		{BEGIN B; printf("%s",yytext);}
"cat "		{BEGIN B; printf("%s",yytext);}
"echo "		{BEGIN B; printf("%s",yytext);}
[^\000]		{printf("%s",yytext);}
%%
----------------cut here------------------------------------
All that this little lex program does is throw away all input until
it sees a word it recognizes. It then goes into state B and simply
transcribes stdin to stdout (hence the name guillotin, it chops off
headers :-) 

I set up cron to wake up every night, go to the usenet maps directory,
assert a uucp lock to keep uuxqt from running while I do. For each
file in the directory run it through "cat $file | guillotin | sh"
mv the output to my real maps directory and rm the usenet map file.
After this I run pathailas on the contents of my real maps dir.

It was pretty simple and I managed to do it in an afternoon. I'm
guess-tamating I spent as much time "re-inventing" a package as I
would have spent hunting it down and installing/understanding it.

-brad-
-- 
v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
Brad Turner	1330 Ashleybrook Ln.	(919) 768-2097	| I speak for myself
3Com Corp.	Winston-Salem, NC 27103 mbt@bridge2	| NOT for my employer.