Пример #1
0
func main() {
	p := pipe.Line(
		pipe.ReadFile("./test.txt"),
		pipe.Exec("lpr"),
	)
	output, err := pipe.CombinedOutput(p)
	if err != nil {
		fmt.Printf("%v\n", err)
	}
	fmt.Printf("%s", output)
}
Пример #2
0
func main() {
	output, err := pipe.CombinedOutput(
		pipe.Line(
			pipe.Exec("ls", "-la", "/usr/bin"),
			pipe.System("grep pp"),
			pipe.WriteFile("grep.txt", 0644),
		),
	)

	if err != nil {
		log.Fatal(err)
	}

	println(string(output))
}