Skip to main content

shell_quote

Function shell_quote 

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

Quote a string safely for inclusion in a shell command line.

Wraps the string in single quotes, replacing any internal single quote ' with '\''. Single-quoted strings are interpreted literally by POSIX shells and PowerShell, preventing command injection and shell metacharacter expansion.