Ignore list
test_1* test_2 test_5
Source file
i need to remove test_1_buddy i need to remove test_1_buddy2 i need to remove test_1 i need to keep_test_10 i need to keep_test_11 i need to remove test_5 i need to remove test_2
Is there any what i remove without using for loop
Why are you putting a condition on the requested solution? Whenever I see a conditional rule, I assume the request is homework.
grep -E -v -f ignore_list source_file
ignore_list file:
test_1([^0-9]|$) test_2 test_5
Thanks i was able to resolve my need buy using this
grep -v -f /root/scripts/exclude_list.txt /var/log/source.log