I want to add word boundaries to this awk command:
awk '{$0=tolower($0)};/wordA/&&/wordB/ { print FILENAME ":" $0; }' myfile.txt
I tried adding \yleft and right of wordAand wordB, but it did not work in my tests.
I tried this:/\ywordA\y/&&/\ywordB\y/
Thanks everyone!
(ps: I'm new to awk, so I tried to avoid the match () function.)
source
share