Write a program i.e. is a version of a shell that can take command(s) from the user and execute them on behalf of the user (by spawning a child process to execute the command on behalf of the parent process). It can only execute a few commands as listed below: [+] mkdir [ ... ] [+] ls [] [+] cp [+] mv [ ... ] [+] rm where parameters enclosed in [ ] are optional parameters. Note that multiple commands are recognized by the shell if each command is delimited by ";". These commands will be executed one after the other. Write a C program will act as a shell interface that should accept and execute each command in a separate process. There should be a parent process that will read the command and then the parent process will create a child process that will execute the command. The parent process should wait for the child process before continuing. Your program should mimic the Linux terminal. This program should be written in C and executed in Linux. You are required to implement five commands out of which one command should be the editor. The program design is entirely up to you but make sure that your shell interpreter is easy to modify.
Write a
[+] mkdir [ ... ]
[+] ls []
[+] cp
[+] mv [ ... ]
[+] rm
where parameters enclosed in [ ] are optional parameters. Note that multiple commands are recognized by the shell if each command is delimited by ";". These commands will be executed one after the other.
Write a C program will act as a shell interface that should accept and execute each command in a separate process. There should be a parent process that will read the command and then the parent process will create a child process that will execute the command. The parent process should wait for the child process before continuing. Your program should mimic the Linux terminal. This program should be written in C and executed in Linux. You are required to implement five commands out of which one command should be the editor. The program design is entirely up to you but make sure that your shell interpreter is easy to modify.
Step by step
Solved in 3 steps with 2 images