Question
C Coding and linux command line 1. Use a while loop to always prompt msh> 2. Any input of exit should exit with status 0.
C Coding and linux command line
1. Use a while loop to always prompt msh>
2. Any input of "exit" should exit with status 0.
3. run Linux commands that are entered by the user. You must do this by using fork and exec . After a command is executed, the prompt should be displayed as usual.
4. dd a help command that will simply display enter Linux commands, or exit to exit
5. Add a today command that will print the current date in the format mm/dd/yyyy, where mm is month, dd is day of month, and yyyy is year. For example, 01/02/2018 is January 2, 2018. Hint: when I implemented this, I used Linux commands time and localtime. Try man 2 time, and man localtime. Its a little tricky.
Here is some sample output to help you understand what your program should do:
msh> ls
temp.txt README.txt
msh> help
enter Linux commands, or exit to exit
msh> foo 1
msh: foo: No such file or directory
msh> today
01/02/2018
msh> 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