Answered You can hire a professional tutor to get the answer.

QUESTION

Translate the pseudo-code below into a C program to act like a small shell that processes single commands entered by the user. In particular, the...

Translate the pseudo-code below into a C program to act like a small shell that processes

single commands entered by the user. In particular, the program assembles the command and

execute it. The commands/programs location can be anywhere in $PATH and might have arguments.

E.g., if the input-line entered by the user is

ls -F

your program should assemble this command-lines and execute it.

The pseudo-code

Algorithm:

While(1)

begin

read command line from user // Use Unix read/write system calls

assemble command args

duplicate current process (fork)

child should exec to the new program

parent process waits for its child to terminate

end

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question