subject
Computers and Technology, 13.05.2021 17:40 quoia89

Abstract: Design, implement, explain, test, and debug a simple, but complete command- line interpreter named cli. Detail: Design, implement, document, test and run a simple shell, known here as a command-line interpreter (cli). This tool is invoked via the cli command plus possible arguments. Commands are OS commands to be executed. Multiple commands are separated from one another by commas, and each may in turn require further arguments. Cli 'knows' a list of commands a-priori; they are predefined. When invoked, cli checks, whether the first argument is an included command. If so, cli confirms this via a brief message. If not, a contrary message is emitted, stating this is not one the predefined commands. After the message, cli executes all commands in the order listed. After executing the last command, cli prints the current working directory, i. e. it acts as if the pwd command had been issued. Sample runs are shown further below.
Multiple commands of cli must be separated from one another by commas. Possible parameters of any one command are separated from the command itself (and from possible further parameters) by white space. White space consists of blanks, tabs, or a combination, but at least 1 blank space. Here some sample runs with single and multiple commands; outputs are not shown here: .
/cli pwd looks like Unix command pwd; is your sw .
/cli rm -f temp, mv temp ../temp1 ditto: input to your running homework 5
./cli ls -la another "single unix command"
./cli rm a. out, gcc sys. c, cp a. out cli
Cli starts out identifying itself, also naming you the author, and the release date. Then cli prints the list of all predefine commands. Finally, cli executes all commands input after the cli invocation. For your own debug effort, test your solution with numerous correct and also wrong inputs, including commas omitted, multiple commas, leading commas, illegals commands, other symbols instead of commas etc. No need to show or hand-in your test and debug work.
The output of the cli command "cli pwd" or "./cli pwd" should be as shown below, assuming your current working directory is ./classes Sac State/csc139. Here is the output of a sample run with a single command line argument:
herbertmayer$ ./cli pwd
hgm cli 4/12/2020
Legal commands: cd exec exit gcc Is man more mv rm pwd sh touch which $path
2 strings passed to argv[]
next string is 'pwd'
new string is 'pwd
1st cind 'pwd' is one of predefined
/Users/herbertmayer/herb/academia/c lasses Sac State/csc139
Here the output of another sample run, also with a single cli command:
herbertmayer$ ./cli ls
hgm cli 4/12/2020
Legal commands: cd exec exit gcc ls man more mv rm pwd sh touch which Spath
2 strings passed to argv[]
next string is 'ls'
new string is 'ls!
1st cmd 'is' is one of predefined. admin cli. c sac state yyy
backup 1 24 2020 docs sac state hw
backup 3 9 2020 grades sac state xxx
cli 1 notes
/Users/herbertmayer/herb/academia/c lasses Sac State/csc139
Interpretation of commands that cli handles can proceed through system(), executed from inside your C/C++ program cli.
List of all commands supported by your cli:
char * cmds [ ] = {
"cd",
"exec",
"exit",
"gcc",
"ls",
"man",
"more",
"mv",
"Im
"pwd"
"sh",
"touch",
"which",
"Spath"
What you turn in:
1. The source program of your homework solution; well commented, preferably one single source file.
2. Four progressively more complex executions of your correctly working cli program, showing all user inputs and corresponding output responses.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:40, vannahboo2022
Program using c++ only on visual studio pig is a simple two player dice game, played with one die. the first player to reach or surpass 50 is the winner. each player takes a turn rolling the dice. they add to the pot with each roll, having to decide to roll again and increase the pot, or cash out. the risk being they could lose the amount they’ve accumulated into the pot. the rules for each player’s die roll. 1. roll the dice. a. if user rolled a 1, i. the pot gets set to zero ii. the other player goes to step 1. b. a roll of 2-6 is added to the pot. 2. user can choose to hold or roll again. a. choice roll. return to step 1. b. choice hold. i. increment player score by the pot amount. ii. pot gets set to 0. iii. second player gets to roll and goes to step 1. program requirements: ● before each opponent begins ○ output the score for the person and the computer. ○ output the opponents whose turn is beginning and ask the user to hit enter to continue. ● with each dice roll. ○ output the die value, and amount of the round pot. ○ if it’s the users roll ask if they want to roll again ( r ) or hold ( h ). your program should allow r, r, h or h as valid input. if input is anything else, ask the user again until valid input is obtained. ○ the ai will continue playing until the round pot is 20 or more. ● once a player’s score is greater or equal to 50 then they have won, it will no longer ask if they want to keep rolling the die or not. ● once there is a winner ○ score totals are output along with who the winner was. user or computer ○ player is asked if they want to play again y or n. valid input should be y, y, or n, n. ● when a new game starts the starting roll goes to the player that did not roll last. if the user rolled last in the previous game, then the computer rolls first and vice versa. when the program first begins, the player will make the first roll of the first game. development notes : ● you will need a way to roll dice in your program. the rand() function works well, but returns an integer. if we want numbers 0 – 9 we can get the value modulus 10. ● call srand() with a value to seed it. it’s common to seed it with the current computer clock, include ctime, and then call srand(time(
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, kreshnikolloma
You wanted to look up information about alzheimer's, but you were unsure if it was spelled "alsheimer's" or "alzheimer's." which advanced search strategy would be useful? a) a boolean search b) using a wild card in your search c) trying different search engines d) doing a search for "alsheimer's not alzheimer's" asap. ill give brainlist.
Answers: 1
image
Computers and Technology, 23.06.2019 23:30, issacurlyheadka
A. in packet tracer, only the server-pt device can act as a server. desktop or laptop pcs cannot act as a server. based on your studies so far, explain the client-server model.
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, cheycheybabygirl01
How can the temperature of a room be raised by 5degreesf?
Answers: 1
You know the right answer?
Abstract: Design, implement, explain, test, and debug a simple, but complete command- line interpret...

Questions in other subjects:

Konu
Mathematics, 28.02.2020 19:04