A shell implementation written in Rust that reads, parses, and executes commands from an interactive prompt. Supports piping commands together and includes several built-in commands handled directly by the shell.
Built with:
- Interactive REPL: reads commands from a prompt in a continuous loop
- Command parsing: splits input into a program name and arguments
- Pipes: chain multiple commands together (
cmd1 | cmd2 | cmd3) - Built-in commands:
cd,pwd,exit,exportrun in-process rather than as subprocesses - Graceful error handling: bad commands or failed spawns report an error and return to the prompt instead of crashing
rust(2024 edition)cargo
No Rust toolchain required. Download bin/rust-shell.exe from this repo and run it directly:
./rust-shell.exe
- Clone the repository:
git clone https://github.com/AdrianTomin/rust-shell.git
cd rust-shell
- Build the project:
cargo build
- Run the tool:
cargo run
> pwd
C:\Users\adrian\rust-shell
> findstr name Cargo.toml
name = "rust-shell"
> exit
cargo test