5 ms·
Are you confusing awk with ack?
by martininmelb 14y ago
Are you confusing awk with ack?
- spullara 14y agoI confused the apps in the text but the point was that those regexes look far worse than the equivalent grep pairs.
- wonderzombie 14y agoAgreed. He says he can't remember the syntax for such and such in grep, but the regexen he follows up with seem complicated enough to me. Now, there's stuff that never sticks in my brain (tests in shell, sigh). But generally there's less syntax and therefore less to remember in a chain of greps. Composition of simple piece is easier to understand than one equivalent and therefore more complex piece. Heck, the power of the shell is predicated on this idea. Perhaps the best part about ack is that it's simple to restrict your search of files to a given pattern with a command line flag rather than using shell globbing. You could wrap invocations of grep with a shell function or another script, but that's still not great.
- joe_the_user 14y agoIt sounds like it. But that too seems like a demonstration of something. The more "simple" methods with obscure names that populate the Unix toolbox, the more confusing it gets. I've gone from find to locate recently, for example, but their functionalities kind of overlap and so when I do find, I'm rusty with it.