Crates.io | conch-runtime-pshaw |
lib.rs | conch-runtime-pshaw |
version | 0.1.6 |
source | src |
created_at | 2021-10-19 20:13:41.263857 |
updated_at | 2021-10-19 20:13:41.263857 |
description | A library for evaluating/executing programs written in the shell programming language. |
homepage | https://github.com/ipetkov/conch-runtime |
repository | https://github.com/ipetkov/conch-runtime |
max_upload_size | |
id | 467508 |
size | 353,765 |
A Rust library/runtime for executing Unix shell commands.
First, add this to your Cargo.toml
:
[dependencies]
conch-runtime = "0.1"
Next, you can get started with by looking at the barebones shell example.
This library offers executing already parsed shell commands as defined by the POSIX.1-2008 standard. This runtime attempts to remain agnostic to the specific Abstract Syntax Tree format a parser could produce, as well as agnostic to features supported by the OS to be as cross platform as possible.
Specifically implementations are provided for all the default AST nodes produced
by the conch-parser
crate. Unlike other Unix shells, this
library supports Windows1 and can likely be extended for other
operating systems as well.
1Major features are reasonably supported in Windows to the extent possible. Due to OS differences (e.g. async I/O models) and inherent implementation exepectations of the shell programming language, certain features may require additional runtime costs, or may be limited in nature (e.g. inheriting arbitrary numbered file descriptors [other than stdio] is difficult/impossible due to the way Windows addresses file handles).
foo && bar || baz
)! foo | bar
)foo &
){ foo; }
)$(foo)
)for
/ case
/ if
/ while
/ until
$foo
, $@
, etc.)${foo:-bar}
)cd
, echo
, etc.)Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.