打印没有 ^M 的文件输出
print the file output without ^M
我有一个包含 ^M 字符的文件
HTTP/1.1 200 OK^M
HOST_SERVICE: FutureTenseContentServer:11.1.1.8.0^M
Transfer-Encoding: chunked^M
Date: Wed, 20 May 2015 02:00:04 GMT^M
Content-Type: text/html; charset=UTF-8^M
X-Powered-By: Servlet/2.5 JSP/2.1^M
^M
^M
^M
^M
^M
我需要使用 cat 或任何 linux 命令在没有 ^M 的情况下打印此文件的输出。
谢谢,
拉维
我真的很抱歉延迟我使用 sed 和管道它到头它将删除最新的五个空行
sed 's/[\^\][M]//' file | head -n 6 > file
输出会像这样
HTTP/1.1 200 OK
HOST_SERVICE: FutureTenseContentServer:11.1.1.8.0
Transfer-Encoding: chunked
Date: Wed, 20 May 2015 02:00:04 GMT
Content-Type: text/html; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1
我有一个包含 ^M 字符的文件
HTTP/1.1 200 OK^M
HOST_SERVICE: FutureTenseContentServer:11.1.1.8.0^M
Transfer-Encoding: chunked^M
Date: Wed, 20 May 2015 02:00:04 GMT^M
Content-Type: text/html; charset=UTF-8^M
X-Powered-By: Servlet/2.5 JSP/2.1^M
^M
^M
^M
^M
^M
我需要使用 cat 或任何 linux 命令在没有 ^M 的情况下打印此文件的输出。
谢谢, 拉维
我真的很抱歉延迟我使用 sed 和管道它到头它将删除最新的五个空行
sed 's/[\^\][M]//' file | head -n 6 > file
输出会像这样
HTTP/1.1 200 OK
HOST_SERVICE: FutureTenseContentServer:11.1.1.8.0
Transfer-Encoding: chunked
Date: Wed, 20 May 2015 02:00:04 GMT
Content-Type: text/html; charset=UTF-8
X-Powered-By: Servlet/2.5 JSP/2.1