commit | 02033fc6c5596e27757e4d8ecb2932d3fae7dd2e | [log] [tgz] |
---|---|---|
author | Keith Rarick <kr@xph.us> | Mon Dec 03 18:21:06 2012 -0800 |
committer | Keith Rarick <kr@xph.us> | Mon Dec 03 18:21:06 2012 -0800 |
tree | 01da55cec5d2a4cdf6048a6f83ba1b092f3921b2 | |
parent | 1fb082f5698c2ea0a69bfb585d9e521a1ca7a896 [diff] |
remove obsolete makefile
Pty is a Go package for using unix pseudo-terminals.
(Note, there is only a Linux implementation. I'd appreciate a patch for other systems!)
go get github.com/kr/pty
package main
import (
"fmt"
"github.com/kr/pty"
"io"
"os"
"os/exec"
)
func main() {
c := exec.Command("grep", "--color=auto", "bar")
f, err := pty.Start(c)
if err != nil {
panic(err)
}
go func() {
fmt.Fprintln(f, "foo")
fmt.Fprintln(f, "bar")
fmt.Fprintln(f, "baz")
f.Close()
}()
io.Copy(os.Stdout, f)
c.Wait()
}