[Gambas-user] shell
Kende Krisztián
nemh at ...2007...
Mon Dec 2 12:53:35 CET 2013
2013-12-02 12:17 keltezéssel, Mike Crean írta:
>
> Hey boys, I am trying to emulate the terminal string sudo sh -c
> 'echo out /sys/class/gpio/gpio27/direction' (works OK in terminal, on
> BBB wheezy arm lxde) I run this from gambas3.5.90 Exec [system.shell,
> "sudo sh -c 'echo out /sys/class/gpio/gpio27/direction'"]
> and get an error /bin/sh: 0: Can't open sudo sh -c 'echo out
> /sys/class/gpio/gpio27/direction' any help please.
So the shell command is the following:
sudo sh -c "echo out >/sys/class/gpio/gpio27/direction"
(with '>') ?
Try this:
Exec ["sudo", "sh", "-c", "echo out >/sys/class/gpio/gpio27/direction"]
Or use Gambas executable with root permission:
File.Save("/sys/class/gpio/gpio27/direction", "out\n")
> I
> have also tried shell "sudo sh -c 'echo out
> /sys/class/gpio/gpio27/direction'" this runs with out error and
> but will not change data in the direction file. It stays at the old
> value of "in".
>
> If
> I run it from a terminal the string works fine.
>
> Thanks
> in advance
> Mike
Kendek
More information about the User
mailing list