{"repo":"alessio/shellescape","free":true,"listed":false,"github":"https://github.com/alessio/shellescape","clone":"git clone https://github.com/alessio/shellescape.git","description":"Escape arbitrary strings for use as command line arguments","language":"Go","stars":201,"topics":["shellescape","shell","string-escape","command-line","shell-scripting","golang","shell-escape","shell-script"],"license":"MIT","category":"cli-tools","readme_excerpt":"shellescape Escape arbitrary strings for safe use as command line arguments. Contents of the package This package provides the shellescape.Quote() function that returns a shell-escaped copy of a string. This functionality could be helpful in those cases where it is known that the output of a Go program will be appended to/used in the context of shell programs' command line arguments. This work was inspired by the Python original package shellescape. Usage The following snippet shows a typical unsafe idiom: See in Go Playground Especially when creating pipeline of commands which might end up being executed by a shell interpreter, it is particularly unsafe to not escape arguments. shellescape.Quote() comes in handy and to safely escape strings: See in Go Playground The escargs utility escargs reads lines from the standard input and prints shell-escaped versions. Unlike xargs , blank lines on the standard input are not discarded.","default_branch":null,"files":null,"tree":[],"storefront":"/r/alessio","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alessio/shellescape/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}