simple_shell is a project that aims to emulate the UNIX shell behavior.
simple_shell project is a program developed in C lenguage using the following concepts:
- PID & PPID
- Arguments
- Executing a program
- Creating processes
- Wait
- File information
- Environment
The key functions and system calls used to develope this program are:
exceve
- exit
- fork
- free
- getline
isatty
- malloc
- perror
- read
- stat
strtok
- wait
- write
https://github.com/sneidergv/simple_shell.git
To compile the shell you need the gcc 4.8.4
version or upper.
Then, compile in this way:
gcc -Wall -Werror -Wextra -pedantic *.c holberton.h -o hsh
Executing the shell in interactive mode follows to interact with the program passing one of the commands allowed one by one until you decide ending the executing process typing exit
or pressing the command Ctrl + D
.
./hsh
Executing the shell in no interactive mode allows pass commands throught pipeline. For instance:
echo "ls -S" | ./hsh
Additionally you can pass several commands stored in a file, like this:
cat <file> | ./hsh
- The simple_shell can perform all the programs stored in the PATH variable.
- Also simple_shell can perform two of the built-in functions:
exit
andenv
.