Skip to content

Commit

Permalink
os/exec: document lack of implicit shell usage or globbing
Browse files Browse the repository at this point in the history
Fixes golang#20894

Change-Id: I0c0e906964bbd789317d07f245e64e3d61ecfa8c
Reviewed-on: https://go-review.googlesource.com/47550
Reviewed-by: Russ Cox <[email protected]>
  • Loading branch information
bradfitz committed Jul 6, 2017
1 parent e71285c commit e335643
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/os/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
// easier to remap stdin and stdout, connect I/O with pipes, and do other
// adjustments.
//
// Unlike the "system" library call from C and other languages, the
// os/exec package intentionally does not invoke the system shell and
// does not expand any glob patterns or handle other expansions,
// pipelines, or redirections typically done by shells. The package
// behaves more like C's "exec" family of functions. To expand glob
// patterns, either call the shell directly, taking care to escape any
// dangerous input, or use the path/filepath package's Glob function.
// To expand environment variables, use package os's ExpandEnv.
//
// Note that the examples in this package assume a Unix system.
// They may not run on Windows, and they do not run in the Go Playground
// used by golang.org and godoc.org.
Expand Down

0 comments on commit e335643

Please sign in to comment.