Skip to content

jydzip/holbertonschool-simple_shell

Repository files navigation

C - Simple Shell

About this project

Simple Shell Project

This project is a simplified version of the Linux shell, developed as part of a group school project.

Objective

The aim of this project is to create a shell capable of interpreting and executing simple commands, similar to those found in Linux-based operating systems.

What is the shell?

The shell is a program that takes commands from the keyboard via the terminal, and gives them to the operating system to perform. documentation shell.

Requirements

  • GCC Logo GCC Language standard gnu89

  • Ubuntu LogoUbuntu 20.04 LTS

  • And minimal understanding of C language

USAGE

Installation

Step 1: Clone the repo

$ git clone https://github.com/jydzip/holbertonschool-simple_shell.git

Step 2: Change directory to holbertonschool-simple_shell:

$ cd holbertonschool-simple_shell

Step 3: install GCC to Ubuntu 20.04 LTS

$ sudo apt update
$ sudo apt install build-essential

Compilation

$ gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh

Run the shell

$ ./hsh

Exiting the "hell": When you want to exit the shell

Option 1: Type the command "exit"

$ exit

Option 2: Press on Ctrl+D

Example of Usage

img

Files

File name Description
main.c Main File, loop of the prompt
split_line.c Split input of the shell in tokens
path.c Retrieve and check the PATH and command exist
shell.c Execute the command

Flowchart

Flowchart

Functions and system calls+ used

  • access (man 2 access)
  • execve (man 2 execve)
  • exit (man 3 exit)
  • fflush (man 3 fflush)
  • fork (man 2 fork)
  • free (man 3 free)
  • getline (man 3 getline)
  • isatty (man 3 isatty)
  • malloc (man 3 malloc)
  • printf (man 3 printf)
  • fprintf (man 3 fprintf)
  • strtok (man 3 strtok)
  • waitpid (man 2 waitpid)

Contribution

This project is being developed in collaboration with other students as part of a team effort. Any additional contribution is welcome.

Authors

This project was carried out by Youssoup, Jeremy and Marc as part of for Holberton School.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages