Hi, All
Who uses jShell under Ubunta ?
What is correct way to start commands ?
If to prepare commands - they work in the terminal, but when try to run by jShell - always error
What file, what directory ? Work directory is existing for sure (it's File.DirApp).
And it's about any other command in a single string.
Trying to start so:
How ?
Who uses jShell under Ubunta ?
What is correct way to start commands ?
If to prepare commands - they work in the terminal, but when try to run by jShell - always error
org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "echo PASSWORD | sudo -S reboot" (in directory "/home/vlad/tempjars"): error=2, No such file or directory)
org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/usr/bin/ls /" (in directory "/usr/bin"): error=2, No such file or directory)
What file, what directory ? Work directory is existing for sure (it's File.DirApp).
And it's about any other command in a single string.
Trying to start so:
B4X:
Sub Run_Command(cli As String)
sh.InitializeDoNotHandleQuotes("cli", cli, Null)
sh.WorkingDirectory = File.DirApp
sh.RunWithOutputEvents(-1)
Wait for cli_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
#if Debug
Log(Success & "; ExitCode = " & ExitCode)
Log("StdOut = " & StdOut)
Log("StdErr = " & StdErr)
#end if
If Success And ExitCode = 0 Then 'all is OK
RunLastError = ""
Else
RunLastError = StdErr
End If
End Sub
How ?
Last edited: