我认为这很容易,但我忽略了一些简单的事情:
我有一个名为test. 例如,它包含字符串Alfred Hitchcock。我想用Alfred\ Hitchcock.
我想这会做到:
grep -r1 ' ' /path/to/test | xargs sed -i 's/ /\ /g'
Run Code Online (Sandbox Code Playgroud)
但它告诉我:
sed: can't read Alfred: No such file or directory
sed: can't read Hitchcock: No such file or directory
Run Code Online (Sandbox Code Playgroud)
不太确定发生了什么。任何帮助都会很棒,谢谢。