sed:sed:-e expression#1,char 63:unterminated`s'命令

时间:2012-05-22 17:01:06

标签: linux bash unix ubuntu sed

我正在尝试使用sed替换文本,但面临以下错误:

[root@server3 ~]# echo "{"playlist":[" | sed 's#{"playlist":[#{"playlist":[{"comment":" text 1","playlist":[#'
sed: -e expression #1, char 63: unterminated `s' command

1 个答案:

答案 0 :(得分:4)

您需要在模式中转义[,因此sed认为您不会尝试启动字符列表。

echo "test" | sed 's#{"playlist":\[#{"playlist":[{"comment":" text 1","playlist":[#'
相关问题