shell_single_quote

Function shell_single_quote 

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

What: Safely single-quote an arbitrary string for POSIX shells.

Input:

  • s: Text to quote.

Output:

  • New string wrapped in single quotes, escaping embedded quotes via the ' '"'"' sequence.

Details:

  • Returns '' for empty input so the shell treats it as an empty argument.