v/examples/process/execve.v

18 lines
296 B
V
Raw Normal View History

2021-02-07 05:19:05 +01:00
module main
import os
fn exec(args []string) {
os.execve('/bin/bash', args, []) or {
// eprintln(err)
panic(err)
2021-02-07 05:19:05 +01:00
}
}
fn main() {
// exec(["-c","find /"]) //works
exec(['-c', 'find /tmp/']) // here it works as well
// exec(["-c","find","/tmp/"]) // does not work I guess is normal
}