MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / shell_escape

Function shell_escape

crates/openshell-driver-vm/src/runtime.rs:295–302  ·  view source on GitHub ↗

Escape a string for use inside bash double quotes.

(s: &str)

Source from the content-addressed store, hash-verified

293
294/// Escape a string for use inside bash double quotes.
295fn shell_escape(s: &str) -> String {
296 s.replace('\\', "\\\\")
297 .replace('"', "\\\"")
298 .replace('$', "\\$")
299 .replace('`', "\\`")
300 .replace('\n', "\\n")
301 .replace('\r', "\\r")
302}
303
304fn build_kernel_cmdline(config: &VmLaunchConfig) -> String {
305 let mut parts = vec![

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected