Linux 使用'更改路径;sed';

Linux 使用'更改路径;sed';,linux,command-line,Linux,Command Line,我正在尝试使用“sed”更改路径 sed -i "s|METASPLOIT_PATH=/opt/metasploit/apps/pro/msf3||METASPLOIT_PATH=/opt/metasploit-framework|g" config/set_config 但是出现了一个我既不理解也不期望的错误 sed: -e expression #1, char 51: unknown option to `s' 这意味着什么???您的命令中有两个连续的管道 尝试: sed -i "s

我正在尝试使用“sed”更改路径

sed -i "s|METASPLOIT_PATH=/opt/metasploit/apps/pro/msf3||METASPLOIT_PATH=/opt/metasploit-framework|g" config/set_config
但是出现了一个我既不理解也不期望的错误

sed: -e expression #1, char 51: unknown option to `s'

这意味着什么???

您的命令中有两个连续的管道

尝试:

 sed -i "s|METASPLOIT_PATH=/opt/metasploit/apps/pro/msf3|METASPLOIT_PATH=/opt/metasploit-framework|g" config/set_config

您的命令中有两个连续的管道

尝试:

 sed -i "s|METASPLOIT_PATH=/opt/metasploit/apps/pro/msf3|METASPLOIT_PATH=/opt/metasploit-framework|g" config/set_config

看起来像是一个打印错误,在替换表达式的中间有一个重复的管道字符。 以下命令起作用:

sed -i "s|METASPLOIT_PATH=/opt/metasploit/apps/pro/msf3|METASPLOIT_PATH=/opt/metasploit-framework|g" config/set_config

看起来像是一个打印错误,在替换表达式的中间有一个重复的管道字符。 以下命令起作用:

sed -i "s|METASPLOIT_PATH=/opt/metasploit/apps/pro/msf3|METASPLOIT_PATH=/opt/metasploit-framework|g" config/set_config