batch-file - Scala Huygens Fokker(仅限命令行)v1.88b 不幸地删除了多余的空格
问题描述
批号:
scala.exe --SET SYNTH 117^
--LOAD /MAPPING \"My mapping\"^
--LOAD \"Intonation with extra spaces\"^
--SEND /FILE \"Test\"^
--EXIT
它给了我输出:
Intonation with extra spaces.scl not found or not a scale file
使用批处理代码:
scala.exe --SET SYNTH 117^
--LOAD /MAPPING \"My mapping\"^
--LOAD \"Intonation without extra spaces\"^
--SEND /FILE \"test\"^
--EXIT
工作正常。
我怎样才能告诉批处理不要忽略多余的空格?
解决方案
不是scala.exe
,但使用一个简单的命令行参数转储工具,我们得到
W:\>type 56190749.cmd
vcCmdLine.exe --SET SYNTH 117^
--LOAD /MAPPING \"My mapping\"^
--LOAD \"Intonation with extra spaces\"^
--SEND /FILE \"Test\"^
--EXIT
W:\>56190749.cmd
W:\>vcCmdLine.exe --SET SYNTH 117 --LOAD /MAPPING \"My mapping\" --LOAD \"Intonation with extra spaces\" --SEND /FILE \"Test\" --EXIT
cmdline:[vcCmdLine.exe --SET SYNTH 117 --LOAD /MAPPING \"My mapping\" --LOAD \"Intonation with extra spaces\" --SEND /FILE \"Test\" --EXIT]
arg_000:[vcCmdLine.exe]
arg_001:[--SET]
arg_002:[SYNTH]
arg_003:[117]
arg_004:[--LOAD]
arg_005:[/MAPPING]
arg_006:["My]
arg_007:[mapping"]
arg_008:[--LOAD]
arg_009:["Intonation]
arg_010:[with]
arg_011:[extra]
arg_012:[spaces"]
arg_013:[--SEND]
arg_014:[/FILE]
arg_015:["Test"]
arg_016:[--EXIT]
W:\>
报价转义的简化给出
W:\>type 56190749.cmd
vcCmdLine.exe --SET SYNTH 117^
--LOAD /MAPPING "My mapping"^
--LOAD "Intonation with extra spaces"^
--SEND /FILE "Test"^
--EXIT
W:\>56190749.cmd
W:\>vcCmdLine.exe --SET SYNTH 117 --LOAD /MAPPING "My mapping" --LOAD "Intonation with extra spaces" --SEND /FILE "Test" --EXIT
cmdline:[vcCmdLine.exe --SET SYNTH 117 --LOAD /MAPPING "My mapping" --LOAD "Intonation with extra spaces" --SEND /FILE "Test" --EXIT]
arg_000:[vcCmdLine.exe]
arg_001:[--SET]
arg_002:[SYNTH]
arg_003:[117]
arg_004:[--LOAD]
arg_005:[/MAPPING]
arg_006:[My mapping]
arg_007:[--LOAD]
arg_008:[Intonation with extra spaces]
arg_009:[--SEND]
arg_010:[/FILE]
arg_011:[Test]
arg_012:[--EXIT]
W:\>
如果参数内部需要双引号,那么我们可以使用
W:\>type 56190749.cmd
vcCmdLine.exe --SET SYNTH 117^
--LOAD /MAPPING "\"My mapping\""^
--LOAD "\"Intonation with extra spaces\""^
--SEND /FILE "\"Test\""^
--EXIT
W:\>56190749.cmd
W:\>vcCmdLine.exe --SET SYNTH 117 --LOAD /MAPPING "\"My mapping\"" --LOAD "\"Intonation with extra spaces\"" --SEND /FILE "\"Test\"" --EXIT
cmdline:[vcCmdLine.exe --SET SYNTH 117 --LOAD /MAPPING "\"My mapping\"" --LOAD "\"Intonation with extra spaces\"" --SEND /FILE "\"Test\"" --EXIT]
arg_000:[vcCmdLine.exe]
arg_001:[--SET]
arg_002:[SYNTH]
arg_003:[117]
arg_004:[--LOAD]
arg_005:[/MAPPING]
arg_006:["My mapping"]
arg_007:[--LOAD]
arg_008:["Intonation with extra spaces"]
arg_009:[--SEND]
arg_010:[/FILE]
arg_011:["Test"]
arg_012:[--EXIT]
W:\>
当然scala.exe
可能会有一些特定的行为,但这是开始尝试的一种方式。
推荐阅读
- php - 在 Laravel 中同时支持旧 Safari 和新 Chrome 时的 SameSite cookie 策略设置
- r - 将数据集与特定标准进行比较
- google-sheets - 为什么我在谷歌表格中得到一个文字数组错误?
- youtube-api - 视频统计 - youtube api
- c# - 填充同一个数据集的不同数据表是线程安全的操作吗?
- javascript - getSecretValue 回调在 AWS Lambda 中不起作用
- javascript - 从数据库中解析 HTML 代码并将其显示在 div 中
- javascript - Node.js:Express 为 CloudFront 设置“信任代理”
- python - 减少芹菜队列中的积压
- flutter - 从 TabBarView 的子级导航到另一个页面会引发错误