/holbertonschool-simple_shell

Dragging Back to work we do with Nehemi

Primary LanguageC

C - Simple Shell


by Anthony Pizzony & Nehemie Mombanga

(Not so) Simple Shell

Table of contents

A brief description of what this project does and who it's for

Description

A UNIX-Shell is a command-line interpreter or "shell" that provides you a command-line user interface for Unix-like operating systems. The Shell is both an interactive and a scripting language. The first Shell was the "Thompson Shell", written by Ken Thompson at Bell Labs, distributed from 1971 to 1975. Ken Thompson developped his Shell version, associated with Dennis Ritchie, in the B programming language. After creating B, Ritchie and teammates moved to language C.

File structure

  • Authors - list of contributors to this project
  • man_simple_shell - manual page for the simple_shell
  • shell.h - header program file
  • Major builtins functions supported:
    - check_builtins.c - check if user's command matches a builtin
    - new_exit - exits the shell
    - print_env - prints the shell environnement's variable to standard output
  • Program running commands:
    - executor: execute process expected
    - exec_path: search a command along the PATH
    - pathfinder: Look in PATH if command exist
  • String Functions:
    - Parser: get_args function creates token words with the command entered, free_argsfunction frees the space allocated for the array of args.
    - wordcount: create tokenized words.
  • Signal Functions:
    - handle_signal: function that handle the signal inputed by (Ctrl^C), doesn't exit the shell but displays a new line.

Requirements

Simple shell project was compiled on Ubuntu 20.04 LTS using gcc compiler, with following options

gcc -Wall -Werror Wextra -pedantic -std=gnu89

Usage

Clone this repository:

git clone git@github.com:NehemieMbg/holbertonschool-simple_shell.git

Switch inside the directory:

cd holbertonschool-simple_shell

Compile all the files with the correct flags and the wildcard *.c :

gcc -Wall -Werror -Wextra -pedantic -std=gnu89 -o ./hsh

You're all good to use the shell either in Interactive mode, to do so enter in your terminal:

./hsh

Then a prompt will be displayed, and you can enter commands.

The other way is in Non-Interactive mode, for example if you want to list files and directory, command ls, call the shell like so:

echo "/bin/ls" | ./hsh

Example of use

This is what our shell looks like:

DuragShell

Authors

The two following persons worked on this project:
Nehemie Mombanga
          - nehemie.mbg@gmail.com
          - https://github.com/NehemieMbg

Anthony Pizzoni
          - piotr62@live.fr
          - https://github.com/HINKOKO

License

Our simple shell is open-source, free to download and use without permissions.

Back to Summary