summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/ionrock/procs/example_predefined_cmds_test.go
blob: 3dfd640153d6b5e56569662e230e2a9f9fc50d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package procs_test

import (
	"fmt"
	"os/exec"

	"github.com/ionrock/procs"
)

func Example_predefinedCmds() {
	p := procs.Process{
		Cmds: []*exec.Cmd{
			exec.Command("echo", "foo"),
			exec.Command("grep", "foo"),
		},
	}

	p.Run()
	out, _ := p.Output()
	fmt.Println(string(out))
	// Output:
	// foo
}