QuoteWord ensures that v is interpreted by a shell as a single word.
(v string)
| 19 | |
| 20 | // QuoteWord ensures that v is interpreted by a shell as a single word. |
| 21 | func QuoteWord(v string) string { |
| 22 | // https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html |
| 23 | // https://www.gnu.org/software/bash/manual/html_node/Quoting.html |
| 24 | return `'` + escapeSingleQuoted(v) + `'` |
| 25 | } |
| 26 | |
| 27 | // QuoteWords ensures that s is interpreted by a shell as individual words. |
| 28 | func QuoteWords(s ...string) []string { |
no outgoing calls