0
日安替换文本,如何找到并使用使用〜作为分隔符使用sed
在bash shell脚本我放在一起,我想找到这样的文字:在/ usr /本地/freeswitch/log/freeswitch.log,取而代之的是:在这个文件中/var/log/freeswitch/freeswitch.log:/etc/fail2ban/jail.local
这是我曾尝试到目前为止,这两者都会导致错误:sed:-e表达式#1,字符75:未终止的's'c ommand
尝试#1
sed -i 's~usr/local/freeswitch/log/freeswitch.log~var/log/freeswitch/freeswitch.log' /etc/fail2ban/jail.local
尝试#2
sed -i 's~usr/local/freeswitch/log/freeswitch.log/var/log/freeswitch/freeswitch.log' /etc/fail2ban/jail.local
我的研究表明,因为我搜索的文本包括 “/” 字符,我应该使用不同的分隔符“〜”来分隔查找和替换字符串。但看起来我做错了什么,任何援助将不胜感激,谢谢。
aaaah,谢谢,谢谢,谢谢!不能相信我错过了这一点 –