state mutex

This commit is contained in:
Mark McGranaghan
2012-10-01 07:58:21 -07:00
parent 39c27a6763
commit ebec3473f2
68 changed files with 6 additions and 7 deletions

View File

@@ -0,0 +1,19 @@
// ## Spawning Processes
package main
import "os/exec"
import "fmt"
func main() {
cmd := exec.Command("ls", "-a", "-l")
out, err := cmd.Output()
if err != nil {
panic(err)
}
fmt.Println("Files:")
fmt.Print(string(out))
}
// todo: full command lines with bash
// todo: piping in stdin

View File

@@ -0,0 +1,6 @@
$ go run spawning-processes.go
Files:
total 8
drwxr-xr-x 3 mmcgrana staff 102 Sep 23 11:35 .
drwxr-xr-x 101 mmcgrana staff 3434 Sep 23 11:25 ..
-rw-r--r--@ 1 mmcgrana staff 241 Sep 23 11:37 spawning-processes.go