When the user enters the most recent command in the history is executed 2 When

When the user enters the most recent command in the

This preview shows page 5 - 6 out of 6 pages.

1. When the user enters !!, the most recent command in the history is executed. 2. When the user enters a single ! followed by an integer N, the Nth command in the history is executed. Continuing our example from above, if the user enters !!, the ps command will be performed; if the user enters !3, the command cal will be executed. Any command executed in this fashion should be echoed on the user s screen. The command should also be placed in the history buffer as the next command. The program should also manage basic error handling. If there are no commands in the history, entering !! should result in a message No commands in history. If there is no command corresponding to the number entered with the single !, the program should output "No such command in history." SUBMISSION DETAILS: Upload a single zip file containing: 1. your code (consisting of your c file), 2. an image file (.jpg or .png) showing a screen capture of your program in action, and 3. a readme.txt file containing instructions to compile your file to the Assignment 1 dropbox on Brightspace. Do not submit the executable. #include "); fflush (stdout); After reading
Image of page 5
user input the steps are (1) fork a child process using fork() (2) the child process will invoke execv (3) if command included &, parent will invoke wait return 0
Image of page 6

You've reached the end of your free preview.

Want to read all 6 pages?

  • Fall '19
  • Exit, Child process, User Commands

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture