bash外殼上的Linux引號:EXEC ARGS(值)由Ant腳本
./mimic_cmd "startDaemon()"
通訊螞蟻代碼:
<exec failonerror="true" executable="/bin/mimic_cmd">
<arg value='"startDaemon()"' />
</exec>
- 是否螞蟻代碼恰好在bash中表示上述命令貝殼?根據調試信息,它看起來像它:
[exec] Executing '/bin/mimic_cmd' with arguments: [exec] '"startDaemon()"' [exec] [exec] The ' characters around the executable and arguments are [exec] not part of the command. Execute:Java13CommandLauncher: Executing '/bin/mimic_cmd' with arguments: '"startDaemon()"' The ' characters around the executable and arguments are not part of the command.
然而,1,而在Bash shell命令返回0
繃vmlauncher沒有按螞蟻的代碼返回和退出代碼沒有幫助,路徑都是正確的。
相同的螞蟻代碼適用於Windows與生成的調試輸出:
[exec] Executing 'C:\bin\mimic_cmd' with arguments: [exec] '"startDaemon()"' [exec] [exec] The ' characters around the executable and arguments are [exec] not part of the command. Execute:Java13CommandLauncher: Executing 'C:\bin\mimic_cmd' with arguments: '"startDaemon()"' The ' characters around the executable and arguments are not part of the command.
mimic_cmd是跨平臺安裝解決方案的shell可執行文件。我不參與開發它的內部團隊,所以老實說,我不能說是否總是需要引號,但有些命令似乎需要它們,或者在括號之前必須有一個空格? 'mimic_cmd StartDaemon()'在ANT和命令行(不包括引號,空格)中不起作用 'mimic_cmd createNewWorkspace(blah)'不帶引號根本不起作用; ''「mimic_cmd createNewWorkspace(blah)」'在Windows上運行,但不能運行在linux上,'mimic_cmd createNewWorkSpace(blah)'同時運行在...(括號之前的空格) – Michael 2010-03-04 00:24:33
嗯......小心那些不帶引號* nix,他們可能正在做一些背後的事情,你不希望......輸入'/ bin/mimic_cmd「createNewWorkspace(blah)」'在* nix命令行上工作嗎?如果是這樣的話,那麼在ANT中''exec failonerror =「true」executable =「/ bin/mimic_cmd」>「如果'blah'本身就是一個字符串,它會變得更有趣:'/ bin/mimic_cmd「createNewWorkspace(\」blah \「)」'或'/ bin/mimic_cmd'createNewWorkspace(「blah」)'' ,在ANT中,'... ...' –
vladr
2010-03-04 00:48:27