Skip to main content

shell_quote

Function shell_quote 

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

Shell-escapes a value for a POSIX shell command.

Wraps the value in single quotes and escapes embedded single quotes as '\''. Single quotes disable every expansion (variables, backticks, globbing).

use strands::sandbox::shell_quote;

assert_eq!(shell_quote("it's"), r"'it'\''s'");