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 us

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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 us

Post by answerhappygod »

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. The 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply