The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 09-01-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
You want to replace them with empty lines, or delete them? Delete is easy:

Code:
fgrep -vf abc Source.txt
For replacing with nothing, perhaps the following:

Code:
sed -e 's%.*%s/.*&.*//%' abc | sed -f - Source.txt
Maybe your sed can't handle standard input for the -f option; if so, report back here and we'll think about workarounds.

Repeated looping over all the input patterns seems awfully inelegant and inefficient.