This is an ALX collaboration project on Shell. We were tasked to create a simple shell that mimics the Bash shell. Our shell shall be called hsh.
- Programming Languages: C, Shell
- Documentation Style: Betty Style Documentation
- All files will be compiled on Ubuntu 20.04 LTS using
gcc
, with the following options:-Wall -Werror -Wextra -pedantic -std=gnu89
- All files should end with a new line
- A README.md file, at the root of the project folder, is mandatory
- Use the Betty style, which will be checked using
betty-style.pl
andbetty-doc.pl
- Ensure the shell does not have any memory leaks
- No more than 5 functions per file
- All header files should be include guarded
- Write a README with a detailed description of the project
hsh is a simple UNIX command language interpreter that reads commands from either a file or standard input and executes them.
- Prints a prompt and waits for a command from the user
- Creates a child process in which the command is checked
- Checks for built-ins, aliases in the PATH, and local executable programs
- The child process is replaced by the command, which accepts arguments
- When the command is done, the program returns to the parent process and prints the prompt
- The program is ready to receive a new command
- To exit: press Ctrl-D or enter "exit" (with or without a status)
- Works also in non-interactive mode
To compile the project, use the following command:
gcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh
Tolulope Olanrewaju, Paul Iyiade