Skip to content

Rohan-Singla/rust-shell-craft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shell-rust

A minimal Unix shell written in Rust, built as part of the CodeCrafters "Build Your Own Shell" challenge.

Features

  • REPL loop — displays a $ prompt and reads commands interactively
  • Built-in commands:
    • echo <text> — print text to stdout
    • type <cmd> — show whether a command is a shell builtin or an external executable (with its full path)
    • exit — exit the shell
  • External command execution — any command not matched as a builtin is looked up in $PATH and executed as a child process

Getting Started

Prerequisites

  • Rust (edition 2024)

Build & Run

cargo build --release
./target/release/shell-rust

Or run directly with:

cargo run

Example session

$ echo hello world
hello world
$ type echo
echo is a shell builtin
$ type ls
ls is /bin/ls
$ ls -la
...
$ exit

Project Structure

src/
└── main.rs   # entire shell implementation

License

MIT

About

A minimal Unix shell written in Rust

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages