Hi guys,
I want to find to print out lines of a chart only if a substring matched in multiple parts of that line. So for ex:
col1 col2 col3 col4
this-dog 0-dog that-dog that-dog
this 4 that-dog that-dog
In this example I would only print Row 2 because the substring dog is present in all instances. I have tried something like this, but it has not worked:
Code:
awk '{if ($1 == /.dog/ && $2 == /.dog/ && $3 == /.dog/ && $4 == /.dog/){print}} file > output
Why won't this work (I don't get an error, I just get a file size of 0) and how can I fix it?
Thanks!