Skip to main content

escape_for_shell

Function escape_for_shell 

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

Escape a string for safe shell usage

Uses single quotes with proper escaping for all special characters. This ensures values from LLM outputs can be safely used in shell commands.

Example: “Hello ‘world’” becomes “’Hello ’'‘world’'‘’”