MCPcopy Create free account
hub / github.com/CrunchyData/postgres-operator / QuoteWord

Function QuoteWord

internal/shell/quote.go:21–25  ·  view source on GitHub ↗

QuoteWord ensures that v is interpreted by a shell as a single word.

(v string)

Source from the content-addressed store, hash-verified

19
20// QuoteWord ensures that v is interpreted by a shell as a single word.
21func 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.
28func QuoteWords(s ...string) []string {

Callers 4

startupCommandFunction · 0.92
MakeDirectoriesFunction · 0.85
QuoteWordsFunction · 0.85
TestQuoteWordFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestQuoteWordFunction · 0.68