In this HackerRank Grep #3 problem solution In this challenge, we practice using the grep command to find specified strings or regular expressions.
Task
You are given a text file that will be piped into your command through STDIN. Use grep to remove all those lines that contain the word 'that'. The search should NOT be sensitive to case.
Input Format
A text file will be piped into your command through STDIN.
Output Format
Only display those lines that do NOT contain the word 'that'. The relative ordering of the lines should be the same as it was in the input file.
Problem solution.
grep -iwv "that"
Second solution.
grep -v -i that
Third solution.
grep -iv that
Fourth solution.
grep -ivw "that"
0 Comments