Rune - Content-locking work 1/2
[rune.git] / tests / fexec.d
1 #!/usr/local/bin/rune -x
2 #
3
4 limport "sys";
5 import "stdio";
6
7 int
8 main(int ac, char **av)
9 {
10         Proc p;
11         const char *av[3];
12         #const char *env[3];
13         char *path;
14
15         av[0] = "ls";
16         #env[0] = "PATH=abcd";
17         #env[1] = "FUBAR=defg";
18
19         path = Sys.getenv("PATH");
20         stdio.stdout->format("PATH: %s\n", path);
21         path = NULL;
22
23         p.fexec("/usr/bin/printenv", av, NULL);
24         p.fwait();
25         stdio.stdout->format("Exit Code %d %d\n", p.error, p.xcode);
26 }