I'm on bash (Mac OS X). I have a list of files and there's a string I want to remove:
$ grep -l \</html\> *.html 21888601.html 21906283.html 21977081.html ...
All matching files are named in this format (.html). Then I try this:
$ grep -l \</html\> 27776977.html | xargs -0 sed -i.back '/<\/html>/d'
The shell just prints out the list of files returned from grep and an error:
sed: 21888601.html 21906283.html 21977081.html ... : File name too long
These filenames are obviously not too long, so there is some other error here. Also, when I test this on files that have alpha names (not all numbers), I don't get the error.
I also tried:
$ grep -l \</html\> 27776977.html | xargs -0 sed -i.back '/<\/html>/d' sed: 27776977.html : No such file or directory $ grep -l \</html\> 27776977.html 27776977.html
Is sed unable to handle numerical filenames? Or is there some other problem here?