First, I think the fact that I'm using cygwin is highly relevant here.
In theory, I already know how to do this:
cat file | xargs grep pattern
The problem is, some of the file paths in
file have spaces. The file looks like this:
subdir/foo/bar.html subdir/f o o/ba r.html subdir/~foo/bar.html
This causes errors. I read how to solve this: use
xargs -0. But I don't know how to make
cat output null terminated line endings, so i think that means it squashes the whole file into one line. As a result, it gives this error:
xargs: argument line too long
Update: it turned out the file I was reading from had some paths that no longer exist. Coincidentally, all of these paths had a
~ in them, so I mistakenly thought that that was an issue. Everything about the spaces still stands though. Turns out those files simply didn't exist.