https://github.com/codedwells/simple_shell
https://github.com/codedwells/simple_shell
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/codedwells/simple_shell
- Owner: Codedwells
- Created: 2022-09-09T10:43:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-19T12:40:29.000Z (over 3 years ago)
- Last Synced: 2025-02-06T21:14:46.053Z (over 1 year ago)
- Language: C
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: history.c
- Authors: AUTHORS
Awesome Lists containing this project
README

### Description
Shell is a simple UNIX command interpreter that replicates functionalities of the simple shell (sh). Additional functions are also included. This program was written entirely in C as a milestone project for ALX Africa Software Engineering.
### Installation
Clone this repository into your working directory. For best results, files should be compiled with GCC and the following flags: -Wall -Wextra -Werror -pedantic -std=gnu89
### Usage
After compilation, the resulting program can run stand-alone, either in interactive or non-interactive mode.
#### Interactive Mode
In interactive mode, simply run the program and wait for the prompt to appear. From there, you can type commands freely, exiting with either the "exit" command or ctrl-D.
#### Non-Interactive Mode
In non-interactive mode, echo your desired command and pipe it into the program like this:
```sh
echo "ls" | ./shell
```
In non-interactive mode, the program will exit after finishing your desired command(s).
#### Included Built-Ins
Our shell has support for the following built-in commands:
| Command | Definition |
| ------------------- | ----------------------------------------------------------------------------------------- |
| exit [n] | Exit the shell, with an optional exit status, n. |
| env | Print the environment. |
| setenv [var][value] | Set an environment variable and value. If the variable exists, the value will be updated. |
| unsetenv [var] | Remove an environment variable. |
| cd [dir] | Change the directory. |
| help [built-in] | Read documentation for a built-in. |