-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
36 lines (28 loc) · 779 Bytes
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* ____ ____ _
* / ___/ ___|| |
* | | _\___ \| |
* | |_| |___) | |___
* \____|____/|_____|
*
* GShellLight. A simple shell. The program takes a command from the user and executes it.
* The program is terminated when the user enters the command 'exit'.
*
* Author: Grindelf P.
* Created on 2023-09-13.
*
*/
#include "mainHeader.h"
int main() {
while_is_used {
char commands[ARG_SIZE][CMD_SIZE];
char *trimmedCommands[TRIMMED_ARG_SIZE];
getArgumentsVector(commands);
trim(commands, trimmedCommands);
if (STOP_NOW) STOP
// int streamRedirection = defineStreamRedirection(commands);
if (!fork()) execute(trimmedCommands[0], trimmedCommands);
else WAIT_FOR_CHILD;
}
return 0;
}