s****a 发帖数: 6521 | 1 echo "\n\n",期待输出两个换行,结果直接输出 \n\n
echo "\r\r"也是一样
为什么? |
c********0 发帖数: 262 | |
d***a 发帖数: 13752 | 3 用两行echo也行:
echo
echo
或者 echo; echo |
s****a 发帖数: 6521 | 4 谢谢。
再问一下,怎样把换行符替换掉?
echo -e "abc\ndef"|sed 's/\n//g' 不起作用 |
l***x 发帖数: 393 | 5 echo -e "abc\ndef"|sed 's/\\n//g'
with two \, you may have to escape the \ |
s****a 发帖数: 6521 | 6
doesn't work in cygwin. don't know how about mac yet.
【在 l***x 的大作中提到】 : echo -e "abc\ndef"|sed 's/\\n//g' : with two \, you may have to escape the \
|
w****e 发帖数: 536 | 7 why not to use perl -ne?
cat FILE | perl -ne 'chomp()' > FILENAME
It should work. you can try. |