The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: grep problem
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 06-05-2008
era era is offline Forum Advisor  
Herder of Useless Cats (On Sabbatical)
  
 

Join Date: Mar 2008
Location: /there/is/only/bin/sh
Posts: 3,652
It's not really a grep problem, per se.

Code:
sed -n 's/-ssl$//p' test.txt | fgrep -vxf - test.txt
This finds all the -ssl lines, and removes the -ssl suffix, then removes any lines matching any of these lines (-ssl lines with the -ssl suffix removed) from the original file.