ShellQuote returns a copied string slice where each element is quoted suitably for sh.
(strs []string)
| 127 | // ShellQuote returns a copied string slice where each element is quoted |
| 128 | // suitably for sh. |
| 129 | func ShellQuote(strs []string) []string { |
| 130 | dup := make([]string, 0, len(strs)) |
| 131 | |
| 132 | for _, str := range strs { |
| 133 | dup = append(dup, ShellQuoteSingle(str)) |
| 134 | } |
| 135 | return dup |
| 136 | } |
| 137 | |
| 138 | // FormatForShell takes a command name and an argument string and returns a |
| 139 | // command and arguments that pass this command to the shell. Note that neither |