Question: Why would I use Process.run when I can use Process.runShellCommand

Hi
I was playing around with the File Write Script example from the bridge. http://arduino.cc/en/Tutorial/FileWriteScript
I changed the line

void runScript() {
  // Run the script and show results on the Serial
  Process myscript;
  myscript.begin("/tmp/wlan-stats.sh");
  myscript.run();

to

void runScript() {
  // Run the script and show results on the Serial
  Process myscript;
  myscript.begin("ls /tmp");
  myscript.run();

And that didn't work.
After reading up I learned about runShellCommand so I tried

void runScript() {
  // Run the script and show results on the Serial
  Process myscript;
  //myscript.begin("/tmp/wlan-stats.sh");
  myscript.runShellCommand("/tmp/wlan-stats.sh");
  //myscript.run();

Which also works with ls /tmp :D.

The documentation of run nor runShellCommand explains me this behaviour.
Can someone explain this behaviour and tell me why I would want to use plain run?

Best regards
Jantje

Official Response

http://forum.arduino.cc/index.php?topic=206416.msg1518664#msg1518664

sonnyyu
Thanks. I must have missed that one when I was looking.
My conclusion: If you need a "parameter" and don't mind pulling in the String class use Process.run all other cases use Process.runShellCommand.
Best regards
Jantje