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:)
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>
- GCC or any C compiler
- Make (optional)
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
To start the shell, run:
./cshell