Question: Translated the pseudo-code below into a C program to act like a small shell that process single command entered by the user. In particular, the

Translated the pseudo-code below into a C program to act like a small shell that process single command entered by the user. In particular, the program assembles the command and executed. it. The command/programs location can be anywhere in $PATH and might have arguments.

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

Is-F

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

The Pseudo-code

Algorithm: While (1) begin read command line from user // Use Unix

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

Step by Step Solution

3.44 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To translate the given pseudocode into a C program that acts like a basic shell follow these steps 1 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!