<br><br><div class="gmail_quote">2010/3/5 Glynn Clements <span dir="ltr"><<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im"><br>
maven apache wrote:<br>
<br>
> Hi, thanks for your detailed reply.<br>
> And I have write a java class according to your instruction,however it can<br>
> not give the right output.<br>
<br>
</div>What output does it give?<br>
<div class="im"><br>
> I test with the spearfish60 data and the<br>
> r.infoprocess.<br>
> Attach my code, can you check it ?<br>
<br>
</div>> public String run(String cmd) {<br>
<br>
> try {<br>
> cmd="/bin/sh -c " + cmd;<br>
> String[] exe={"/bin/sh -c",cmd};<br>
<br>
> Process p1=rt.exec(exe,env);<br>
<br>
I suggest that you don't use the shell; it just makes life harder.<br>
Instead, define:<br>
<br>
public String run(String[] cmd) {<br>
...<br>
Process p1=rt.exec(cmd, env);<br>
<br>
and use:<br>
<br>
gm.run({"<a href="http://r.info" target="_blank">r.info</a>", "map=roads"});<br>
<font color="#888888"><br>
--<br></font></blockquote><div>Hi, I use the following:<br><br>public String run(String[] cmd) {<br> String[] exe = { "bash", "-c", cmd }; <br> Process p1=rt.exec(exe, env);<br>...<br><br>Now it works, thank you anyway! I can not make it work without your patient explanation these days! Your are a good guy!<br>
<br>Also, I want to say "Thank you" to everyone who have help me complete my job.! :)<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<font color="#888888">
</font><div><div></div><div class="h5">Glynn Clements <<a href="mailto:glynn@gclements.plus.com">glynn@gclements.plus.com</a>><br>
</div></div></blockquote></div><br>