This project involves creating a MiniShell, a command-line interpreter that reads commands from the standard input and executes them. Key features include:
- Execution of commands separated by |.
- Input redirection (<), output redirection (>), and error redirection (>&).
- Background execution of commands ending with &.
- Built-in commands like cd, jobs, fg, exit, and umask.
- Handling of SIGINT signals without terminating the MiniShell.
Name | GitHub Nickname |
---|---|
Tarek Elshami Ahmed | @TarekElshami |
Álvaro Serrano Rodrigo | @AlvaroS3rrano |
- User input is read from the command line.
- The command is tokenized into a tline structure.
- The command is checked if it is an internal command (cd, jobs, fg, umask, exit) or external.
- For internal commands: execute the respective function.
- For external commands: handle pipes if needed, fork child processes, redirect input/output as necessary, and execute the command using execvp.
Tjobs: Manages background processes with fields for process IDs, command line string, and statuses.
An array of Tjobs is initialized to manage up to 30 background commands. Each job tracks command execution details and statuses.
SIGINT signal is handled to display the prompt or terminate processes as needed.
Background jobs are tracked, displayed, and managed. fg brings jobs to the foreground, waiting for their completion.