Skip to main content
Improved formatting and link to CLI switches; added the meaning of the switches rather than just linking; added a better link (though perl documentation is really fragmented)
Source Link
user1794469
  • 4.2k
  • 1
  • 27
  • 42

You could use perl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'

Where the Perlswitches are as follows:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'
-w turns on warnings
-n runs perl against each line of input (looping)
-e executes perl passed in the command line

You could use Perl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'

You could use perl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'

Where the switches are as follows:

-w turns on warnings
-n runs perl against each line of input (looping)
-e executes perl passed in the command line

You could use perlPerl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'
perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'

You could use perl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'

You could use Perl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'
added 3 characters in body
Source Link
michas
  • 21.9k
  • 5
  • 71
  • 95

You could use perl:

perl -wne 'print if (/term1/ && /search_term1term2/) || (/search_term2term1/ ) && !(/search_term3term3/ xor /term4/))'

You could use perl:

perl -wne 'print if ( /search_term1/ || /search_term2/ ) && !/search_term3/'

You could use perl:

perl -wne 'print if (/term1/ && /term2/) || (/term1/ && (/term3/ xor /term4/))'
Source Link
michas
  • 21.9k
  • 5
  • 71
  • 95
Loading