Skip to content

Instantly share code, notes, and snippets.

@mattn
Created April 15, 2013 11:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattn/5387356 to your computer and use it in GitHub Desktop.
Save mattn/5387356 to your computer and use it in GitHub Desktop.
package main
import (
"labix.org/v1/pipe"
"log"
)
func main() {
output, err := pipe.CombinedOutput(
pipe.Line(
pipe.Exec("ls", "-la", "/home/mattn"),
pipe.System("grep foo"),
pipe.WriteFile("grep.txt", 0644),
),
)
if err != nil {
log.Fatal(err)
}
println(string(output))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment