You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f844d44
Browse filesBrowse the repository at this point in the historyBrowse files
Add Shell method for running commands via the system shell
Adds a new Shell method (and package-level Shell function) that runs
a command line through the native OS shell (sh -c on Unix, cmd /C on
Windows), rather than parsing arguments manually like Exec does. This
allows correct variable expansion when used with WithEnv, fixing the
issue described in #239, while leaving Exec unchanged for backward
compatibility.
|[`Shell`](https://pkg.go.dev/github.com/bitfield/script#Shell)| command output, run via the system shell |
316
317
|[`Slice`](https://pkg.go.dev/github.com/bitfield/script#Slice)| slice elements, one per line |
317
318
|[`Stdin`](https://pkg.go.dev/github.com/bitfield/script#Stdin)| standard input |
318
319
@@ -362,6 +363,7 @@ Filters are methods on an existing pipe that also return a pipe, allowing you to
362
363
|[`RejectRegexp`](https://pkg.go.dev/github.com/bitfield/script#Pipe.RejectRegexp)| lines not matching given regexp |
363
364
|[`Replace`](https://pkg.go.dev/github.com/bitfield/script#Pipe.Replace)| matching text replaced with given string |
364
365
|[`ReplaceRegexp`](https://pkg.go.dev/github.com/bitfield/script#Pipe.ReplaceRegexp)| matching text replaced with given string |
366
+
|[`Shell`](https://pkg.go.dev/github.com/bitfield/script#Pipe.Shell)| filtered through the system shell |
365
367
|[`Tee`](https://pkg.go.dev/github.com/bitfield/script#Pipe.Tee)| input copied to supplied writers |
366
368
367
369
Note that filters run concurrently, rather than producing nothing until each stage has fully read its input. This is convenient for executing long-running commands, for example. If you do need to wait for the pipeline to complete, call [`Wait`](https://pkg.go.dev/github.com/bitfield/script#Pipe.Wait).
0 commit comments