perlquestion
bigswifty00000
multiple regex logical AND
<P>
Hey All!
<P>
I am trying to check a config file for the existence and settings of two parameters.
<P>
I believe it requires a logical AND.
<P>
<P>
I realize that this is checking for an AND on the same line,
<P>
perl -nle 'print $ARGV if !$seen{$ARGV}++ ;print if /^JRECOV="yes"/|/^TEOJ=-w"/' *
<P>
ALSO printing the filename only if BOTH conditions are met.
<P>
I can't seem to find the regex that will work for this, any help would be greatly appreciated.
<P>
Thanks!
<P>
BigSwifty00000
<P>
Sorry, I realized my LAST test was with an OR, after I posted.
<P>
Carry on!
<P>
BigSwifty0000
<P>
I corrected the missing " and tried this (this file has the 2 params set to what I'm searching for)
<P>
perl -nle 'print $ARGV if !$seen{$ARGV}++ ;print if /^JRECOV="yes"/&&/^TEOJ="-w"/' ss1lab02
<P>
AND
<P>
perl -n00 -le 'print $ARGV if !$seen{$ARGV}++ ;print if /^JRECOV="yes"/ms &&/^TEOJ="-w"/ms' ss1lab02
<P>
Neither is returning the lines (filename is returned)