Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试使用 sed 替换文本,但遇到以下错误:
[root@server3 ~]# echo "{"playlist":[" | sed 's#{"playlist":[#{"playlist":[{"comment":" text 1","playlist":[#' sed: -e expression #1, char 63: unterminated `s' command
您需要[在模式中转义,因此 sed 不会认为您正在尝试启动字符列表。
[
echo "test" | sed 's#{"playlist":\[#{"playlist":[{"comment":" text 1","playlist":[#'