I have a simple command I want to execute and process the result back in Dart, but I am failing to do this on my Ubuntu server.
On my Windows desktop, I can execute this without problems, but I am not able to create the correct command in Ubuntu.
This is what I am trying (I got this from Why can't Dart's "Process.start" execute an Ubuntu command when the command works in Ubuntu terminal?):
Process.run('bash', ['-c', '/usr/bin/python -V']).then((ProcessResult results) {
print(results.stdout);
print(results.stderr);
});
When I execute this, I get the following error:
bash: /usr/bin/python: No such file or directory
Obviously, python is installed, available at /usr/bin/python and is working fine. The strange thing is, executing this works fine:
Process.run('bash', ['-c', 'git version']).then((ProcessResult results) {
print(results.stdout);
print(results.stderr);
});
I can't see any difference in executing the python command versus the git command...
Can anyone see something wrong? Thanks in advance!