codeskyblue / go-sh

like python-sh, for easy call shell with golang.
Apache License 2.0
1.11k stars 141 forks source link

It is possible to get the stdoutPipe? #14

Open houle opened 8 years ago

houle commented 8 years ago

It is possible to get the stdoutPipe? just as func (c *Cmd) StdoutPipe() (io.ReadCloser, error) if so, we can get the output when we exec the commands

codeskyblue commented 8 years ago

not implemented. but you can try with that.

s = sh.Command("tailf", "some.log")
rd, wr := io.Pipe()
s.Stdout = wr
# wr is stdoutPipe should returns.
codeskyblue commented 8 years ago

BTW: you can make a pr