This commit is contained in:
Mark McGranaghan 2012-10-10 11:58:48 -07:00
parent d3bc797a70
commit 27ce28247b
3 changed files with 3 additions and 4 deletions

View File

@ -1,6 +1,5 @@
# When we run our program it is replaced by `ls`.
$ go run execing-processes.go
$ ls -a -l -h
total 16
drwxr-xr-x 4 mark 136B Oct 3 16:29 .
drwxr-xr-x 91 mark 3.0K Oct 3 12:50 ..

View File

@ -31,8 +31,8 @@ func main() {
fmt.Println(string(dateOut))
// Next we'll look at a slightly more involved case
// where we pipe data to the exteranl process on its
// `stdin` and collect the results from `stdout`.
// where we pipe data to the external process on its
// `stdin` and collect the results from its `stdout`.
grepCmd := exec.Command("grep", "hello")
// Here we explicitly grab input/output pipes, start

View File

@ -1,5 +1,5 @@
# The spawned programs return output that is the same
# as if we had run them directly form the comand-line.
# as if we had run them directly from the command-line.
$ go run spawning-processes.go
> date
Wed Oct 10 09:53:11 PDT 2012