I figured this would be easy, but I'm overlooking something simple:
I have a text file called
test. It contains, for example, the string
Alfred Hitchcock. I want to replace this with
I figured this would do it:
grep -r1 ' ' /path/to/test | xargs sed -i 's/ /\ /g'
But it tells me:
sed: can't read Alfred: No such file or directory sed: can't read Hitchcock: No such file or directory
Not quite sure what's going on. Any help would be great, thanks.