<p>You can use or look at the code in ct_ssh:exec/3 in the Commontest application.<br>
It does what you are looking for i.e. executes a command and returns the output as data.</p>
<p>/Kenneth , Erlang/OTP Ericsson</p>
<div class="gmail_quote">Den 13 aug 2012 23:54 skrev "Thomas Elsgaard" <<a href="mailto:thomas.elsgaard@gmail.com">thomas.elsgaard@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
Does anybody have a good simple example of executing commands on a<br>
remote server via SSH?<br>
<br>
Nothing fancy, just something like:<br>
<br>
------<br>
Connect to host<br>
Execute command '/bin/ls'<br>
Read output from command<br>
Close connection<br>
------<br>
<br>
Best regards<br>
<br>
Thomas<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>
</blockquote></div>