Skip to content

Sheru is my basic shell written in C. It works like a simplified version of Bash, handling command execution, built-in functions, and environment variables.

Notifications You must be signed in to change notification settings

Mohamed-El-Mouhib/Sheru

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sheru is a simple Unix shell clone, built as a learning project. It replicates basic shell behavior, handles multiple commands and redirections, and supports a few essential built-in commands. Features

Executes commands with arguments and redirections

Supports piping and environment variables

Built-in commands:

    cd — change directory

    pwd — print current directory

    echo — supports only -n flag

    exit — exit the shell with optional code statue

    env — print environment variables

    export — set or append to environment variables (VAR=..., VAR+=..., or print sorted list)

Setup

Clone the repository:

git clone https://github.com/asynthmorpheonx/Sheru.git
cd Sheru

Build the executable:

make

This will generate the Sheru binary.

Usage

Start the shell by running:

./Sheru

Once running, you can type commands just like in a standard shell. Use built-ins like cd or export, or run external programs if they’re in your PATH. Notes

The Sheru handles Ctrl+C and Ctrl+\ signals gracefully.

Environment is inherited from the parent, unless started with env -i.

Redirection and piping work with combinations of built-ins and external commands.

About

Sheru is my basic shell written in C. It works like a simplified version of Bash, handling command execution, built-in functions, and environment variables.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •