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 15:20
The north and south regions had very diferent economies in the 1800s.
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
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, 31.08.2021 20:10
question
Mathematics, 31.08.2021 20:20
Questions on the website: 13722363