subject

Shell. c below is a stripped down shell program. It will run a Unix command without any arguments. Copyand save the program as shell. c. Modify the program so that it can execute any shell command. It shouldbe able to take at least 2 arguments. Usually, you need to parse the command line you enter. Using execvpinstead of execlp will probably help. It should work on any UNIX command consisting of 0-2 argumentsafter the command entered by the user, and be error free. The following are a few test cases that the usercould enter.$ cp file1 file2$ ls -l$ whochar *strtok(char *str, const char *delim)is a useful function for parsing the input string. Youcan see below how it used "\n" as a delimiter to get everything before that character. You can specify " " asa delimiter to split the string into arguments. The first time you use it, give it a string as the first parameterto tokenize. This will return the first token. You can then use it subsequent times with NULL as the firstparameter and it will return subsequent tokens in order. After the last token was returned, it returns NULL. For example if you wrote:charinput [ ] = " Hello World ! " ;strtok ( input , " " ) ;strtok (NULL, " " ) ;strtok (NULL, " " ) ;...the first call would return "Hello". The second call would return "World!". And the third call wouldreturn NULL.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:40
Respecting individual differencespre-test active2time remaining48: 47nina is exploring her gender identity and sexual orientationwhich best describes how the role of the media might influence nina during this time in her life? the media would her decide because television shows are always unbiased about gender issues and do notstereotypethe media could make things difficult for her because television sometimes portrays rigid ideas about gender roles.all forms of media will her decide because the media always portrays rigid ideas about gender roles.all forms of media will make things easy for her because the media always portrays open and fair ideas about gender roles.
Answers: 1
question
Computers and Technology, 22.06.2019 08:30
Today is the anniversary of me being on yet, i don't need it anymore! here's a picture of my dog wearing a bowtie! my question is, how do i delete my account?
Answers: 1
question
Computers and Technology, 22.06.2019 15:00
Hyperactive media sales has 10 windows 7 laptop computers used by sales-people in the organization. each laptop computer has several customized applications that are used during the sales process as well as customer relationship management software. all of the applications on the laptops are difficult to configure and have large data files. if all of the laptops have current hardware, what is the easiest way to install windows 10 on them?
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
You know the right answer?
Shell. c below is a stripped down shell program. It will run a Unix command without any arguments. C...
Questions
question
Mathematics, 10.09.2020 21:01
question
Chemistry, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
History, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
question
Mathematics, 10.09.2020 21:01
Questions on the website: 13722363