windows CMD在双引号内发送CRLF

时间:2016-06-13 22:36:05

标签: cmd ffmpeg newline

我想为ffplay或ffmpeg传递多个标头,它说我需要与CRLF分开。在linux上我可以使用\$'\r\n'但是如何使用Windows?

SET CRLF=^
ffplay -v debug -i "http://example.com/test" -headers "Accept-Language: en-US,en;q=0.5%CRLF%Connection: keep-alive"

调试日志:Connection: keep-alive未发送

[http @ 04df3f40] No trailing CRLF found in HTTP header.
[http @ 04df3f40] request: GET /test HTTP/1.1 0KB sq=    0B f=0/0
User-Agent: Lavf/57.37.101
Accept: */*
Range: bytes=0-
Connection: close
Host: example.com
Icy-MetaData: 1
Accept-Language: en-US,en;q=0.5

感谢

1 个答案:

答案 0 :(得分:0)

请尝试以这种方式设置CRLF。它可能会奏效。

C:\Users\pwatson>type t.bat
@echo off
setlocal enabledelayedexpansion

REM === The following line -MUST- be followed by two (2) blank lines.
SET CRLF=^


REM === DO NOT EDIT THE PREVIOUS TWO (2) LINES

echo this is a!CRLF!new line

然后,运行它。

C:\Users\pwatson>call t.bat
this is a
new line