jinyistudio Well-Known Member Licensed User Longtime User May 30, 2021 #1 Hi It working in rpi3 when i run "echo 1 > /dev/sys-led" in the command line. following code it can't working but ProcessCompleted is success when i run it in my b4j no-ui-app but jshell B4X: Copy Dim lst As List lst.Initialize2(Array As String($"'${jylab.IIF(sysledst,1,0)}'"$,">","/dev/sys-led")) Dim shl As Shell shl.Initialize("gpio","echo",lst) shl.Run(-1) sysledst = Not(sysledst)
Hi It working in rpi3 when i run "echo 1 > /dev/sys-led" in the command line. following code it can't working but ProcessCompleted is success when i run it in my b4j no-ui-app but jshell B4X: Copy Dim lst As List lst.Initialize2(Array As String($"'${jylab.IIF(sysledst,1,0)}'"$,">","/dev/sys-led")) Dim shl As Shell shl.Initialize("gpio","echo",lst) shl.Run(-1) sysledst = Not(sysledst)
Erel B4X founder Staff member Licensed User Longtime User May 30, 2021 #2 The redirection is a feature of the Linux terminal. It is not a feature of "echo" so it cannot work. You can probably do it by running bash. In Windows it is done by running cmd.exe /c. Upvote 0
The redirection is a feature of the Linux terminal. It is not a feature of "echo" so it cannot work. You can probably do it by running bash. In Windows it is done by running cmd.exe /c.
jinyistudio Well-Known Member Licensed User Longtime User May 31, 2021 #3 Ha. It is OK ? B4X: Copy File.WriteString("/dev","sys-led",jylab.IIF(sysledst,"1","0")) Upvote 0