Path: utzoo!utgpu!water!watmath!clyde!att!rutgers!ucsd!ucsdhub!esosun!seismo!uunet!fsc2086!jim
From: jim@fsc2086.UUCP (Jim O'Connor)
Newsgroups: comp.unix.questions
Subject: Re: more unix jokes - /dev/null
Summary: lex a grep that you don't have to hope for
Keywords: poor man's Unix
Message-ID: <261@fsc2086.UUCP>
Date: 25 Sep 88 04:32:33 GMT
References: <8488@smoke.ARPA> <26090@ucbvax.BERKELEY.EDU> <1049@sybase.sybase.com> <192@bales.UUCP>
Organization: Filtration Sciences Corp., Chattanooga, TN
Lines: 34

In article <192@bales.UUCP>, nat@bales.UUCP (Nathaniel Stitt) writes:
> Re: How to simulate "command > /dev/null" without a /dev/null.
> 
> How about:
> 
> 	command | grep i_hope_this_does_not_appear_in_the_output
> 

If you've got lex, you don't have to hope.  Just build a program using the
lex instructions:

%%
\n	|
.*	;
%%

which if I recall from my manual, should not print anything.  (i.e. all
input is matched and discarded).

Now that I think about it.  This is probably more effiecient

#include 
main()
{

while (getchar() != EOF)
   ;

}
---
James B. O'Connor		+1 615 821 4090 x651
Filtration Sciences Corp.      UUCP:  uunet!fsc2086!jim
105 West 45th Street           or      jim@fsc2086.UUCP
Chattanooga, TN 37411