Building cross reference -- how?
D. Hugh Redelmeier
hugh-pmF8o41NoarQT0dZR+AlfA at public.gmane.org
Mon Oct 14 07:09:04 UTC 2013
| From: William Park <opengeometry-FFYn/CNdgSA at public.gmane.org>
| To: tlug-lxSQFCZeNF4 at public.gmane.org, kwlug-disc-BDyrTanuHcXYtjvyW6yDsg at public.gmane.org
Addressing mail to two lists causes problems. My last reply bounced
from the kw list -- I hadn't realized that I'd sent it there.
| On Sun, Oct 13, 2013 at 01:03:46PM -0400, D. Hugh Redelmeier wrote:
| > What's wrong with the multiple fgrep solution that you came up with?
| > The answer might help us understand your problem better.
|
| Nothing wrong with grep solution, really. It's better than awk
| solution,
| awk '$0 ~ re1 && $0 ~ re2 {print}'
| because awk is doing 2 full passes whereas grep is doing somewhere
| between 1 and 2 passes.
I don't know what you mean by passes. I guess you mean: scans of a
line in the buffer. That's generally cheap. The number of times you
read the file is more expensive. Both read it once.
&& is a conditional AND, so the right side will only be
evaluated if the left is true (probably rare).
| But, I think this road is "dead end".
That implies you are wanting to go somewhere, but we cannot help if we
don't know where that is.
--
The Toronto Linux Users Group. Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
More information about the Legacy
mailing list