This commit is contained in:
Mark McGranaghan
2012-09-23 14:31:05 -07:00
parent d1e82077ac
commit 64aa4acf05
69 changed files with 1 additions and 1 deletions

17
070-spawn/spawn.go Normal file
View File

@@ -0,0 +1,17 @@
// ## Spawn
package main
import ("os/exec"; "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

6
070-spawn/spawn.sh Normal file
View File

@@ -0,0 +1,6 @@
$ go run spawn.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 spawn.go