Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Unix Shell

A custom, basic Unix shell implementation written in C++ (C++23).

Features

This shell provides a basic command-line interface with support for several built-in commands and the ability to execute external programs found in your system's $PATH.

  • Built-in Commands:

    • exit: Exits the shell.
    • echo: Prints text to the standard output. Handles single quotes ('), double quotes ("), and escape characters (\).
    • pwd: Prints the current working directory.
    • cd: Changes the current directory. Supports cd ~ (home directory), cd - (previous directory), and standard paths.
    • type: Indicates how a command name would be interpreted (e.g., shell builtin or an external executable path).
  • External Command Execution:

    • Executes any valid command found in the directories listed in the $PATH environment variable.
  • I/O Redirection:

    • > or 1>: Redirect standard output to a file (overwrite).
    • >> or 1>>: Redirect standard output to a file (append).
    • 2>: Redirect standard error to a file (overwrite).
    • 2>>: Redirect standard error to a file (append).

Building the Shell

To compile the shell, you need a C++ compiler that supports C++23 (like g++).

Run the following command in the project root:

make

This will compile src/main.cpp and generate an executable named shell.

Running the Shell

After building, you can start the shell by running:

./shell

You will be greeted with the $ prompt, ready to accept your commands.

Cleaning Up

To remove the compiled executable, run:

make clean

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages