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

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 Databases Questions!