Question: The project must be implemented on Linux platforms using C or C + + language. Textbook: p . 7 6 - > Lab 2 .

The project must be implemented on Linux platforms using C or C++ language.
Textbook: p.76-> Lab 2.1. A simple shell...
attacking the problem
Begin your solution by reading the UNIX example in Section 2.4. You will have to rewrite
that code to support user interaction. Here is a header file, minishe 11.h, for your mini-
shell:
Here is the skeleton of a solution:
1**
This is a very minimal shell. It finds an executable in the
PATH, then loads it and executes it (using execv). Since
It uses N.N (dot) as a soparator, it cannot handle file
names like "
minishell.hN
The focus on this exercise is to use fork, PMTH variables,
The focus on this exercise is to use fork, PAPH variables,
the end of Chapter 9.
*include...
finclude "minishel1. h
/ Shell initialization */
parsePath(pathv); /* Get directory paths from PATH */
while(TRUB)1
printPrompt():
1* Read the command line and parse it */
readcommand (comondine)
parseCommand (cormandtine, scommand);
I* Get the full pathnare for the file *
command.name = lookupPath(command.axgv, pathv);
if (
comand.name == NULL)
Report error *
continue;
r
Create child and execute the comenand */
creat
/* Wait for the child to terminate */
,
/* Shell termination */
,
The project must be implemented on Linux

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!