Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cross platform library to execute shell scripts

License

Notifications You must be signed in to change notification settings

caido/shell_exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

Shell Exec

github crates.io

Execute shell scripts asynchronously on multiple platforms. The goal of the library is to provide a simple interface to execute a user provided script on any shell. We try to avoid as much as possible writing temporary files.

use std::time::Duration;
use shell_exec::{Execution, Shell};
let execution = Execution::builder()
 .shell(Shell::Bash)
 .cmd(
 r#"
 INPUT=`cat -`;
 echo "hello $INPUT"
 "#
 .to_string(),
 )
 .timeout(Duration::from_millis(10000))
 .build();
let data = execution.execute(b"world").await.unwrap();
assert_eq!(b"hello world"[..], data);

About

Cross platform library to execute shell scripts

Topics

Resources

License

Stars

Watchers

Forks

Languages

AltStyle によって変換されたページ (->オリジナル) /