Scrunch blank lines

Dave Brower daveb at gonzo.UUCP
Wed Mar 29 03:14:59 AEST 1989


In article <6839 at cg-atla.UUCP> duane at cg-atla.UUCP (Andrew Duane) writes:
>> In article <620 at gonzo.UUCP> daveb at gonzo.UUCP (Dave Brower) writes:
>>So, I offer this week's challenge:  Smallest program that will take
>>"blank line" style cpp output on stdin and send to stdout a scrunched
>>version with appropriate #line directives.  [f]lex, Yacc, [na]awk, sed,
>>perl, c, c++ are all acceptable.
>
>If shell scripts are acceptable, how about:
>
>	#!/bin/sh
>	cat -s
>
>You may have to use "more" rather than cat. The moral: please
>don't reinvent the wheel [1/2 ;-)]

Sorry, you lept at the naive and incorrect solution.   Please  say "with
appropriate #line directives."  Cat -s obfuscates matching the output
lines with the input lines.  That is the point of the challenge.

I have two entries so far, one in "lex" and another in "awk".  Both are
less than 20 lines.  It will be interesting to compare timings between
awk, gawk, nawk, lex and flex.

-dB
-- 
"I came here for an argument." "Oh.  This is getting hit on the head"
{sun,mtxinu,amdahl,hoptoad}!rtech!gonzo!daveb	daveb at gonzo.uucp



More information about the Comp.lang.c mailing list