Skip to main content

split_command_segments

Function split_command_segments 

Source
pub fn split_command_segments(cmd: &str) -> Vec<&str>
Expand description

Split a shell command into segments on ;, &, |, and newline.

Quote-aware: delimiters inside single quotes, double quotes, or after a backslash escape do not split. For example printf '%s' 'skip; python -V' is ONE segment whose command word is printf.