我有许多不同的文件,其中包含一个字符串。我需要用路径替换该字符串,尽管该路径包含空格。到目前为止,我有这个:
for a in files_[a-z][a-z]_all\.conf ; do
fileWithPath="~/Downloads/files_config_linux/auth-user-pass files_userpass.txt"
otherOne="auth-user-pass mullvad_userpass.txt"
sed -i 's|'$otherOne'|'$fileWithPath'|g' $a
done
但我得到
sed:-e 表达式 #1,字符 16:未终止的“s”命令
我的问题是如何用包含空格的路径正确替换该字符串。
谢谢!