yihong0618 和朋友们的频道 头像

消息来源频道

yihong0618 和朋友们的频道

@hyi0618

频道8,612 位成员公开可见0 人在线

yihong0618 和朋友们的频道

成员规模8,612 位成员
在线情况0 人在线
消息总数10,129 条消息
浏览量总数3,276,841 次浏览

在这个频道里搜索消息……

t.me/hyi0618

TIL:
Link: https://github.com/jbranchaud/til/blob/master/sed/use-an-alternative-delimiter-in-a-substitution.md
📌 Use An Alternative Delimiter In A Substitution
A pretty standard sed substitution command is going to use / (the forward
slash) as the delimiter. The delimiter separates the different parts of the
command.
$ sed 's/critter/creature/' animals.txt
The first delimiter marks the beginning of the regular express to be replaced.
That expression is everything up to the next delimiter. Then the substute
expression starts up until the next delimiter.
There is nothing special about the / as the delimiter, it just happens to be
the most commonly used character.
In fact, any visible character can be used as the delimiter with sed.
Some other common ones are :, |, and _. I like how the pipe character
looks.
$ sed 's|critter|creature|' animals.txt
But like I said, any visible character will work. If you wanted, you could use
Q though that'll look strange and could cause some confusion when reading
through your script.
$ sed 'sQcritterQcreatureQ' animals.txt