https://github.com/taskcluster/shell
go library to shell escape command line parameters
https://github.com/taskcluster/shell
Last synced: 2 months ago
JSON representation
go library to shell escape command line parameters
- Host: GitHub
- URL: https://github.com/taskcluster/shell
- Owner: taskcluster
- License: mpl-2.0
- Created: 2016-11-08T13:24:02.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-11-15T17:19:14.000Z (over 6 years ago)
- Last Synced: 2024-06-19T03:08:28.402Z (almost 2 years ago)
- Language: Go
- Size: 11.7 KB
- Stars: 4
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# shell
[](https://godoc.org/github.com/taskcluster/shell)
[](http://travis-ci.org/taskcluster/shell)
[](https://github.com/taskcluster/shell/blob/master/LICENSE)
Escape command line parameters to be executed on the shell.
Ported from https://github.com/xxorax/node-shell-escape.
## Usage
```
package main
import (
"fmt"
"github.com/taskcluster/shell"
)
func main() {
fmt.Println(
shell.Escape(
"curl",
"-v",
"-H",
"Location;",
"-H",
"User-Agent: dave#10",
"http://www.daveeddy.com/?name=dave&age=24",
),
)
}
```
produces...
```
curl -v -H 'Location;' -H 'User-Agent: dave#10' 'http://www.daveeddy.com/?name=dave&age=24'
```