Question: 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
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
