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 Lab A simple shell...
attacking the problem
Begin your solution by reading the UNIX example in Section You will have to rewrite
that code to support user interaction. Here is a header file, minishe for your mini
shell:
Here is the skeleton of a solution:
This is a very minimal shell. It finds an executable in the
PATH, then loads it and executes it using execv Since
It uses NN 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
include
finclude "minishel h
Shell initialization
parsePathpathv; Get directory paths from PATH
whileTRUB
printPrompt:
Read the command line and parse it
readcommand comondine
parseCommand cormandtine scommand;
I Get the full pathnare for the file
command.name lookupPathcommandaxgv, pathv;
if
comand.name NULL
Report error
continue;
r
Create child and execute the comenand
creat
Wait for the child to terminate
Shell termination
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
