Skip to content
Advertisement

grep -v with while read line command not working properly

I use this command

JavaScript

to remove lines from (target.txt) that match string in (removefrom.txt)


This is (target.txt)

JavaScript

This is (removefrom.txt)

JavaScript

This is the result should look like:

JavaScript

But sometimes the resule is like:

JavaScript

or

JavaScript

or

JavaScript

I ever try to use sed, but the problem is still there, It didn’t remove lines properly.

Advertisement

Answer

grep -vf removefrom.txt target.txt

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement