只是为了澄清:OSX上的sed的man-page(10.8; Darwin内核版本12.4.0)说:
[...]
Sed正则表达式
The regular expressions used in sed, by default, are basic regular expressions (BREs, see re_format(7) for more information), but extended
(modern) regular expressions can be used instead if the -E flag is given. In addition, sed has the following two additions to regular
expressions:
1. In a context address, any character other than a backslash (``\'') or newline character may be used to delimit the regular expression.
Also, putting a backslash character before the delimiting character causes the character to be treated literally. For example, in the
context address \xabc\xdefx, the RE delimiter is an ``x'' and the second ``x'' stands for itself, so that the regular expression is
``abcxdef''.
2. The escape sequence \n matches a newline character embedded in the pattern space. You cannot, however, use a literal newline charac-
ter in an address or in the substitute command.
[...]
所以我猜一个人必须使用tr - 如上所述 - 或者漂亮
sed "s/,/^M
/g"
注意:您必须在vi编辑器中键入 -v,才能获得'^M'