+ -
当前位置:首页 → 问答吧 → [求助] sed -e "s@^@ @"啥子意思

[求助] sed -e "s@^@ @"啥子意思

时间:2007-11-22

来源:互联网

如题,查了半天没查到:)

作者: bikecheng   发布时间: 2007-11-22

sorry,查到了,原来是@在搜索的时候要用原名啊(at sign),答案如下,希望大家也可以用到:
[addr1[,addr2]]s/expr/string/[flags]
Searches the indicated lines for a string of characters matching the expression defined by expr, and replaces that set of characters with string. This command's operation is modified by the g, p, and w file flags.[Table Note 4] If either expr or string includes a slash (/), you must escape the literal slash with a backslash (s/path/path\/file/) or use alternative delimiters such as the at sign (@) or question mark (?). For example, s@path@path/file@ replaces path with path/file.

作者: bikecheng   发布时间: 2007-11-22

简而言之就是作分割符,就不用对regex里的“/”转义了...

作者: Jockey   发布时间: 2007-11-22

分隔符不一定必须是 / 的,只要保证三个符号一致就可以。

作者: anbutu   发布时间: 2007-12-20

热门下载

更多