Skip to content

SD191100/devsh-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Custom Shell in C++

A lightweight, minimalist shell built in C++ that mimics basic Unix shell behavior. This shell supports built-in commands, path resolution, and external command execution.

πŸ”Ή Features

βœ”οΈ Basic shell prompt with user info
βœ”οΈ Built-in commands: echo, exit, type
βœ”οΈ Execute system commands like ls, pwd, cat
βœ”οΈ Custom path resolution using $PATH
βœ”οΈ Handles single (' ') and double (" ") quotes correctly
βœ”οΈ Supports whitespace-separated arguments and paths as well

πŸ“Œ Example Usage

ubuntu % echo "Hello, World!"
Hello, World!

ubuntu % ls
devsh.cpp  mysh

ubuntu % type echo
echo is a shell builtin

ubuntu % exit

πŸ“Œ How It Works

πŸ›  Built-in Commands

Command Description
echo "Hello" Prints Hello to the console
exit && exit0 Exits the shell
type command Checks if a command is built-in or present in binary path

πŸ’» Running System Commands

You can execute any system command available in $PATH:

ls -l
pwd
cat file.txt

πŸ“¦ Installation & Usage

πŸ›  Prerequisites

Ensure you have:

  • g++ (GCC Compiler)
  • Linux/macOS terminal (Windows users can use WSL)

⚑ Installation Steps

1️⃣ Clone the repository

git clone https://github.com/sd191100/devsh-shell.git

2️⃣ Compile the shell

g++ devsh.cpp -o devsh -std=c++17 -lstdc++fs

-std=c++17 and -lstdc++fs are optional parameters

3️⃣ Run the shell

./devsh

Now, you're inside your custom shell! πŸŽ‰

ubuntu % echo "Hello, World!"
Hello, World!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages