This is simply a recreation of a shell that takes user inputs (commands with arguements) and output accourntly Basic loop of a shell :
- Print input
- Read a line from a standa input (solution)
- Turn the command lines string into an executable program
- Execute
| files | content |
|---|---|
| Authors | List of contributors to this project |
| Readme | The README file |
| Shell.h | The header file |
| main.c | File that contain the main code |
| execute.c | File contain the execute functions |
| path.c | File that contain the path functions |
| split.c | File that contain the split functions |
| _realloc.c | Function containing realloc |
| getenv.c | Function contain env functions |
| functions.c | Function that contain builtins |
- the prompt is displayed each time a command has been executed
- This program displays a prompt and wait for user type a command
- When the user type EXIT, shell will end and exit the interface
- The program print the current environement when user type ENV
- The program execute the most commun shell commands such as
- LS
- PWD
- CD
- EXIT
- ENV
- History ... with arguments
- The program quit when the user enter CTRL + C
- The user could stop the program using CTRL + D
List of allowed functions and system calls in this project :
access (man 2 access)
chdir (man 2 chdir)
close (man 2 close)
closedir (man 3 closedir)
execve (man 2 execve)
exit (man 3 exit)
fork (man 2 fork)
free (man 3 free)
fstat (man 2 fstat)
getcwd (man 3 getcwd)
getline (man 3 getline)
kill (man 2 kill)
lstat (man 2 lstat)
malloc (man 3 malloc)
open (man 2 open)
opendir (man 3 opendir)
perror (man 3 perror)
read (man 2 read)
readdir (man 3 readdir)
signal (man 2 signal)
stat (man 2 stat)
strtok (man 3 strtok)
wait (man 2 wait)
waitpid (man 2 waitpid)
wait3 (man 2 wait3)
wait4 (man 2 wait4)
write (man 2 write)
_exit (man 2 _exit)
How the shell actually works : A parents process is one that creates a child process using a fork () system call. On the success of a fork() system call, the pid of the child process is returned to the parent process and 0 is returned to the child process. on the failure to the parent process a child process is not created.
Authors :
- Mahdi Bani < 5035@holbertonschool.com >
- Mohamed Ali Krifa < 4997@holbertonschool.com >
- Imen Mansouri < imen.mansouri@holberthonstudents.com >
This project was made as part of the curriculum in HOLBERTON SCHOOL


