-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.c
24 lines (20 loc) · 815 Bytes
/
shell.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "shell.h"
/**
* main - Entry point of the shell program
*
* Description: This function serves as the main entry point for the shell program.
* It repeatedly prompts the user for a command, reads the command
* from the standard input, and then executes the command.
*
* Return: Always returns 0 to indicate successful termination of the program.
*/
int main(void)
{
char command[128]; /* Buffer to store the command entered by the user */
while (1) {
show_prompt(); /* Display the shell prompt to the user */
read_command(command, sizeof(command)); /* Read the command entered by the user */
execute_command(command); /* Execute the command entered by the user */
}
return 0; /* Successful termination of the program */
}