groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] grohtml - "too many open files"


From: Keith MARSHALL
Subject: Re: [Groff] grohtml - "too many open files"
Date: Fri, 1 Dec 2006 15:24:05 +0000

Walter Harms wrote, quoting Ralph Corderoy:
>> ... if you've a grep that produces
>> 1E6 lines and you just want to read the first then pipe it into
>> `sed 1q' before reading it into awk so the grep gets a SIGPIPE on
>> writing to the finished sed, curtailing its largess.
>
> To access head or tail of a ascii file the 'head' and 'tail' commands
> are what you are looking at (prevents reading the whole file just to
> get the result).

And if the one line you are looking for is somewhere between 1E5 and 2E5,
in the 1E6 lines of the original stream?

   ... | grep pattern | sed 1q

will get the first line which matches pattern, regardless of where it
appears in the stream, which I think, is what Ralph said.

Regards,
Keith.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]