p.runShellCommand not working on Yun

hey !

Wrote a very simple arduino sketch which uses Process to communicae with linino.

The arduino sketch is as follows.

#include <Process.h>

void setup() {
Bridge.begin();   // Initialize the Bridge
Process p;
p.runShellCommand("/root/run.sh");
while (p.running()){ ; }
while (p.available()) { ; }
delay(5000);  
}
void loop()
{
}

run.sh is as follows

#! /bin/sh
touch touched

When I run /root/r.sh , touched is created.
But when I uploaded the sketch to arduino it did not work.
In one of the previous thread, a user had the ame problem, and the solution was to change the permissions.
I did change the permissions of run.sh using

chmod 755 run.sh

Still no results.

Would be grateful to you if you can help me out.

It might hide at:

/usr/lib/python2.7/bridge/

use absolute path for safe side.

/bin/touch  /mnt/sda1/touched

Thank you so much it wourked! :smiley:

What should i do if i were to run a python script instead of the touch command?

eg

#! /bin/sh
python /root/example.py

reply to the previous message.

you could just

#! /bin/sh
python /root/example.py

Thanks for the help.

Using

#!/usr/bin/python

to create python file which runs independently

http://forum.arduino.cc/index.php?topic=224609.msg1627106#msg1627106