Skip to content

A simple shell implemented in C to teach myself about C.

Notifications You must be signed in to change notification settings

benbarten/cshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CShell

CShell is a simple command-line shell implemented in C. It supports basic built-in POSIX commands and can execute external commands.

Note: This is just an educational project of mine to teach myself come basic C. Do with it whatever you like:)

Features

Built-in commands:

  • pwd: Print the current working directory.
  • cd <directory>: Change the current directory.
  • echo <message>: Print a message to the terminal.
  • exit: Exit the shell.
  • env: Get/set/list environment variables.
  • Execution of external commands in your $PATH.
  • Environment variable expansion.
  • Input / Output redirection with < and >
  • Piping via <command> | <command>

Getting Started

Prerequisites

  • GCC or any C compiler
  • Make (optional)

Building

To build the project, run:

gcc -o cshell main.c builtin.c external.c parse.c envvars.c

Alternatively, if you have make installed, you can use the provided Makefile:

make

Running

To start the shell, run:

./cshell

About

A simple shell implemented in C to teach myself about C.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published