Crate shells [−] [src]
Wrapper around std::process::Command which make the use of Rust for shell scripting more appealing.
Simple example
let (code, stdout, stderr) = sh!("echo '{} + {}' | bc", 1, 3); assert_eq!(code, 0); assert_eq!(&stdout[..], "4"); assert_eq!(&stderr[..], "");
A mnemotechnic to remember the ordering of the elements in the resulting tuple is the positions of stdout and stderr, they correspond to the standard streams numbers: 1 and 2 respectively.
If I a missing your favorite (at least partially) POSIX-compliant shell, submit a pull request!
Macros
ash! |
Macro to execute the given command using the Almquist Shell. |
bash! |
Macro to execute the given command using the Bourne Again Shell. |
csh! |
Macro to execute the given command using the C Shell. |
dash! |
Macro to execute the given command using the Debian Almquist Shell. |
fish! |
Macro to execute the given command using the Fish Shell. |
ksh! |
Macro to execute the given command using the Korn Shell. |
mksh! |
Macro to execute the given command using the MirBSD Korn Shell. |
sh! |
Macro to execute the given command using the Posix Shell. |
tcsh! |
Macro to execute the given command using the TENEX C Shell. |
zsh! |
Macro to execute the given command using the Z Shell. |