Skip to main content

needs_real_shell

Function needs_real_shell 

Source
pub fn needs_real_shell(command: &str) -> bool
Expand description

Check if a command needs shell features we don’t handle.

Redirection counts as such a feature. Virtual commands receive a plain argument list built by splitting on whitespace, so a redirection left in that list is passed through as a literal argument: echo hello > out.txt would print hello > out.txt and write no file, and git push ... 2>&1 would report success while nothing was pushed. Handing the whole command to the system shell is the only way to get exactly the POSIX result (issue #46).