Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'grep faster and more effectively than grep, using grep' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
grep faster and more effectively than grep, using grep
Authored by: dzurn on May 25, '07 07:17:29AM

Mac OS X has *nix underpinnings, so Unix hints are incredibly valuable for some tasks. I'm using the hints on this site as a Mac (power) user who wants to harness what these tools can provide. Yes, we could obtain and read the entire BASH Reference Manual or scour through the scarcely-readable "sh(1)" man page, but *nix is not something we use for hours on end and have hardwired into our fingertips.

Second, your "faster" example doesn't work for me. I tried it in sh, csh, zsh and it never returns what is expected. The first example works and is much easier to understand, and so might get used in the future.

The whole reason for the hint was to show a way to avoid remembering and escaping all the regex characters when we just want to match a bit of text in some other task.

Please don't denigrate this hint on the basis that it's not fast enough. You can however go ahead and denigrate us because we have only so much time to deal with learning and remembering the huge body of *nix tools.

Mac OS X is a tool to get something else done, it's not an end in itself. Learning all the *nix conventions and optimizations is not first on my list of things to do.

Madness takes its toll.
Please have exact change.

[ Reply to This | # ]
grep faster and more effectively than grep, using grep
Authored by: sweth on May 25, '07 06:04:19PM

You need to learn to read better (which might explain why manpages are so baffling to you). I never said that the hint wasn't fast enough; I said that it was pointless, because the speed of an interactive invocation of grep is very rarely going to be functionally helped by the switch to fgrep, and if speed really were an issue, using fgrep would rarely be the best solution. I've seen literally hundreds of people over the years get caught up in trying to optimize things that don't need to be optimized, and in ways that don't really help them; all I was trying to do was prevent people from wasting their time on what is almost always a fruitless endeavor.

(I'll concede that for people not familiar with regular expressions, the ability to use fixed strings instead of regexes could make fgrep useful, but that's not what the hint claims to be showing people to do. And judging from the current rating of the hint, it would seem that I'm not alone in not thinking that this is not a great hint.)

[ Reply to This | # ]