Question: 7 . 7 execute execute [ id ] - This built - in command executes the command associated with the List Node. To implement this
"execute" execute id This builtin command executes the command associated with the List Node. To implement this built in command, you will call the provided function runcommand an implementation of the function has been provided to you which will be linked in during compilation which will run the command associated with the List Node. The function prototype of the providing function is the following: int runcommandListNode ; The provided function runcommand has an integer return type representing the status information of the command that was ran. You will need to extract the exit status of the return value the exit status is stored in bits of the returned integer. After extracting the exit status, if you get a non zero exit status then the command exit status indicates an unsuccessful execution. If the function returns an unsuccessful execution, then your shell must print an error message by utilizing the following: fprintfstderr "error: s
strerrorexitstatus; If incorrect number of arguments provided are provided, then you must print an error by utilizing the following: fprintfstderr "error: incorrect number of arguments
; If the id argument provided is not valid, then you must print an error by utilizing the following: fprintfstderr "error: s
Id does not exist"; Your shell must only execute commands with at most arguments including the command itself. If more than arguments are present, then your shell must print the following error message: "error: too many arguments" by utilizing the following: fprintfstderr "error: s
"too many arguments"; Assumptions: Failure to follow the assumptions listed for the new built in command will result in the command not being executed and thus potentially resulting in a segmentation fault Depending on the command for the List Node, the List Nod
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
