MCPcopy Create free account
hub / github.com/appleboy/easyssh-proxy / shellQuote

Function shellQuote

easyssh.go:545–547  ·  view source on GitHub ↗

shellQuote returns s wrapped in POSIX single quotes so it can be passed as one shell word. Embedded single quotes are escaped using the close-quote/backslash-quote/open-quote idiom.

(s string)

Source from the content-addressed store, hash-verified

543// one shell word. Embedded single quotes are escaped using the
544// close-quote/backslash-quote/open-quote idiom.
545func shellQuote(s string) string {
546 return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'"
547}
548
549// Scp uploads sourceFile to remote machine like native scp console app.
550func (ssh_conf *MakeConfig) Scp(sourceFile string, etargetFile string) error {

Callers 2

WriteFileMethod · 0.85
TestShellQuoteFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestShellQuoteFunction · 0.68