What Keith said. Grep is implemented as a simple string.contains whereas an egrep will take the argument and compile it with Pattern.compile(arg). And when dealing with java, it does full matches, so adding the .* to start and end is necessary.
John On Fri, Jul 27, 2012 at 2:20 PM, Keith Turner <[email protected]> wrote: > I think you need to do egrep .*adsf.* to match the substring > > On Fri, Jul 27, 2012 at 1:02 PM, Kristopher Kane <[email protected]> > wrote: > > All, > > > > Trying to use egrep in the shell on v1.3.4 - help says it is a java > format > > regex but what does that mean from the shell? egrep "asdf" -c ... > doesn't > > match anything whilst grep "asdf" -c ... does. What's required for the > > regex argument? > > > > Thanks, > > > > -Kris >
