Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

- Create a subdirectory under your $HOME directory for this lab assignment. - Using vi editor, manually type in the entire code in Fig 1.10

image text in transcribed
image text in transcribed
image text in transcribed
- Create a subdirectory under your \$HOME directory for this lab assignment. - Using vi editor, manually type in the entire code in Fig 1.10 of the textbook in shell 2.c. You may use 'vi' editor as much as you can. (for this lab assignment only) set tabstop to 2-4 spaces to your preference set "set sm" (show match) along with other set ups like tabstop for your programming convenience in /.vimrc. use 'diff' tool to compare what you typed up with the original one (apue.3e/intro/shel12.c) that you untarred in HWI. - Copy the "apue. 3e/intro/Makefile' into your homework directory. This is the only file you may copy from the directory. Then modify the "Makefile" to compile the new "she112. c" successfully with other. h files and libraries under "apue. 3e " directory. - Now, modify your "she 112.c " file for the following requirements: Use execvp() intead of execlp() to execute child processes. The original "she112" program in Fig 1-10 of the APUE textbook page 19 (Section 1.9 Signals) supports command name only and it doesn't handle any options or arguments so '1s -1' command would give you "couldn't execute: ..." error message. But your "myShe 112 " would be a bit smarter - it would support most of options and arguments, not just command name alone. NOTE: If you allocated any dynamic memory in your program for any reasons, please make sure you free the heap memory allocated for your Expected Output Examples: Hints - To handle the command options, define an array of C-strings, cmd_strs. Note that C-string is an array of chars. What would be the data structure of an array of C-stings

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Auditing Assurance And Risk

Authors: W. Robert Knechel, Steve Salterio, Brian Ballou

3rd Edition

0324313187, 9780324313185

More Books

Students also viewed these Accounting questions