1

I run the following command which comments out all lines that contain the text "dlclose"

grep -lIR "dlclose" . | grep -v ".svn" | xargs sed -i "s/.*dlclose.*/\/\/&/g"

However, sed claims that the piped files don't exist:

sed: can't read ./Utilities/src/DynLib.cpp: No such file or directory

This doesn't make any sense since grep was able to find and pipe the filename.

What is going on here? Is it piped in the wrong format?


Also, as a side note, I would like to merge the two greps, but I am forced to use grep 2.5.1 which doesn't have exclude-dir

user50914
  • 121
  • 1
  • 3

1 Answers1

2

If the file is a symlink pointing to a non-existant file, that's the error you'll get.

pjz
  • 10,497
  • 1
  • 31
  • 40