Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a program ( myshell 1 . c ) to do the following task in a loop ( 1 ) get a command from standard
Write a program myshellc to do the following task in a loop
get a command from standard input, into a variable
if the command is "exit"
then exit the program to be terminated
else if the command is "listall"
then you replace the input by Is la
else if the command is "showme"
then replace the command by w grep xyz where xyz is the first characters of your netid
for example, w grep rkm for netidrkm
else run the command via system call
call a system call to run the input command, eg systemIs l;
repeat the loop that is back to step
compile the program and its executable name is: myshell and run the program with the following input commands
date ; hostname ; uname a
Is I
Is mydir.txt
Is I $HOME myhome.txt
who grep 'whoami'
w myuser.txt ; w grep 'whoami'
listall
showme
Is I myshellc
head myshellc
exit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started