<div dir="ltr"><div><div>While on the topic, could we please have an "cmd()" which takes a program name and a list of parameters, instead of just a string?<br></div>That would be less prone to both whitespace errors and injection issues.<br>
</div>Using os:cmd() with anything but a fixed string always gives me an uneasy feeling:<br><div><br>15> Echo = fun(Text) -> os:cmd("echo "++Text) end.        <br>#Fun<erl_eval.6.106461118><br>16> Echo("Hello!").<br>
"Hello!\n"<br>17> Echo("; date").<br>"\nfre jun 27 11:51:07 CEST 2014\n"<br><br></div><div>(On the other hand, I'm glad that open_port() *does* support the program name + argument list mode.)<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-27 10:29 GMT+02:00 Lukas Larsson <span dir="ltr"><<a href="mailto:lukas@erlang.org" target="_blank">lukas@erlang.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Hello,</div><div><br></div><div class="gmail_extra"><div class="gmail_quote"><div class="">On Fri, Jun 27, 2014 at 3:39 AM, KukHyun Lee <span dir="ltr"><<a href="mailto:kukhyun@gmail.com" target="_blank">kukhyun@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello,<br>
<br>
erl on Windows7, os:cmd doesn't parse 'white-space'.<br>
<br>
C:\>erl<br>
Eshell V6.0  (abort with ^G)<br>
1> os:cmd("c:/Program Files/test.exe").<br>
'c:/Program' is not recognized as an internal or external command,<br>
operable program or batch file.<br>
[]<br>
<br></blockquote><div><br></div></div><div>Thanks for reporting this bug! I believe that I have fixed it already. Unfortunately the fix introduces a backwards incompatibility so it will not be released until OTP 18.  The fix is already merged into the master branch at github.</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>Lukas</div></font></span></div></div></div>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>