Open Amid68 opened 5 days ago
This is the core structure that will read user input, interpret commands, and execute them.
3.1 Shell prompt:
$
mysh$
3.2 Read user input:
getline()
3.3 Parse the input:
strtok()
strsep()
3.4 Command execution:
fork()
execvp()
waitpid()
3.5 Exit functionality:
exit
I've completed the initial REPL implementation. Next, I'll refactor the code into multiple files and add more error handling.
This is the core structure that will read user input, interpret commands, and execute them.
3.1 Shell prompt:
$
or custom string likemysh$
).3.2 Read user input:
getline()
to capture input from the user.3.3 Parse the input:
strtok()
orstrsep()
).3.4 Command execution:
fork()
to create a child process.execvp()
to execute the parsed command.waitpid()
to wait for the child to finish executing.3.5 Exit functionality:
exit
command to quit the shell.