-
-
Notifications
You must be signed in to change notification settings - Fork 798
Open
Description
Description
I am a odin newbie so I might overlooked something but as a way of learning odin I wanted to make simple build system for odin. And when I was trying to spawn shell process I didn't find anything to do this in core
.
Example solution in Odin
For example something like this:
package main
import "core:process"
import "core:fmt"
main :: proc () {
process_handle, process_spawn_err := process.spawn({"echo", "'Hello, World"})
if process_spawn_err != nil {
fmt.panicf("Failed to start command: %v", process_spawn_err)
}
output := process.output(process_handle)
fmt.println(output)
}
Solution in Rust
use std::process::Command;
let output = Command::new("echo")
.arg("Hello world")
.output()
.expect("Failed to start command")
println!("{output}")
thetarnav and Dima-369