Skip to main content

escape_shell

Function escape_shell 

Source
pub fn escape_shell(s: &str) -> String
Expand description

Escape a string for embedding in a POSIX single-quoted shell string literal.

Wraps the string in single quotes and escapes embedded single quotes as '\''. Single-quoted shell strings treat every character literally except ', so no other escaping is needed.