sed 命令如何把windows格式的空行去掉
linux格式的空行,我能去掉了。windows格式的,执行命令还是原来的。
不知道怎么弄了。 [code]sed -E '/^($|\r)/d' file[/code] [b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=221530&ptid=53211]2#[/url] [i]cfwyy77_bat[/i] [/b]
sed -E '/^($|\r)/d' tyre.txt # 这样tyre.txt并没有被改写
sed -E '/^($|\r)/d' tyre.txt > vv.txt # 这样文件被改写到vv.txt,
原档tyre.txt并没有被改写。怎么直接改到tyre.txt上呢? [b]回复 [url=http://bbs.bathome.net/redirect.php?goto=findpost&pid=221532&ptid=53211]3#[/url] [i]netdzb[/i] [/b]
sed [color=Red]-i[/color] -E [b]回复 [url=http://www.bathome.net/redirect.php?goto=findpost&pid=221532&ptid=53211]3#[/url] [i]netdzb[/i] [/b]
加 -i 参数 。既然要用sed, sed --help总要看一看吧{:3_53:}
页:
[1]