tengo
tengo copied to clipboard
exec.command usage
Hello,
How exactly should one correctly call an external program using Tego?
I tried to replicate the exec.command example here: https://github.com/d5/tengo/blob/master/docs/stdlib-os.md#processstate
~ >> cat myapp.tengo
fmt := import("fmt")
os := import("os")
cmd := exec.command("echo", ["foo", "bar"])
output := cmd.output()
fmt.println(output)
Running it returns Compile Error: unresolved reference 'exec'. I checked the Tengo code and as far as I can tell exec is a sub-function of os?
I also tried proc := start_process("ls", ["-a"], "", []) but got a similar error. Is there any other documentation or examples out there?
Thanks! :)
Greetings!
I was just looking for examples of tengo. Your code is perfect. Exchange exec.Command for os.exec:
cat > myapp.tengoTell me if it worked.