Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ VISUAL STUDIO need help creating a shell program using C++ The following requirements are what I'm having the most trouble with, thank you.. c.
C++ VISUAL STUDIO
// If we hit EOF, replace it with a null character and return. if (Itokens) \& fprintf(stderr, "Lsh: allocation errorln"); exit(EXIT_FAILURE): 3 1 token = strtok (NULL, LSHLTOKOELIM) 3 tokens [position] = NULL; return tokens; 1 twe ebrief Loop getting input and executing it. void tsh loop(void) \{ char * Line; char *args; int status; do \{ printf ( "ls >", shetlnane): tine = lsh_read_tine(); args = lsh_sptit_Line(tine); status = Lsh_execute(args); (lfree(line); Iffree(args): 3 while (status): 1 ebrief Main entry point. eparan argc Argunent count. eqaran argy Argunent vector. egreturn status code / int main(1nt argc, char wiargv) 1 I/ Load config files, if any. If Run comand loop. lsh_Loop( ) ; // Perforin any shutdown/cleanup. return EXIT_SUCCESS; if (Itokens) \& fprintf(stderr, "Lsh: allocation errorln"); exit(EXIT_FAILURE): 3 1 token = strtok (NULL, LSHLTOK DELIM) 3 tokens [position] = NULL; return tokens; 1 twe ebrief Loop getting input and executing it. void tsh loop(void) \{ char * Line; char *args; int status; do \{ printf ( "ls >", shetlnane): tine = lsh_read_tine(); args = lsh_sptit_Line(tine); status = Lsh_execute(args); (lfree(line); Iffree(args): 3 while (status): 1 ebrief Main entry point. eparan argc Argunent count. eqaran argy Argunent vector. egreturn status code / int main(1nt argc, char wiargv) 1 I/ Load config files, if any. If Run comand loop. lsh_Loop( ) ; // Perforin any shutdown/cleanup. return EXIT_SUCCESS; c. (3 marks) SETTERMINATOR >: Sets the terminator in the myshe 11 command prompt to >. If no terminator is defined, myshe 11 should use > as the default terminator. d. (10 marks) NEWNAME I old name : Manages the alias list. The first option deletes a previously defined alias. The second option defines an alias for another command. For example, the command NEWNAME mymove deletes the alias for mymove, the command NEWNAME mycopy cp defines mycopy as the alias for the cp command. If an alias for a command already exists, then the new alias replaces the old alias. The maximum number of aliases in the alias list should be set to 10 as the default. e. (6 marks) LISTNEWNAMES: Outputs all the aliases that have been defined. Each pair of names should be shown on one line. For example, the possible aliases for a few commands are shown below: mycd cd mycopy cp f. (6 marks) SAVENEWNAMES > : Stores all currently defined aliases in the file need help creating a shell program using C++
The following requirements are what I'm having the most trouble with, thank you..
c. SETTERMINATOR: sets terminator in "myshell" command prompt to inputted variable. If no terminator is defined, "myshell" should use > as the default.
d. NEWNAME: manages the alias list. The first option deletes a previously defined alias. The second optiom defines an alias for another command. Example: the command "NEWNAME mymove" deletes the alias for "mymove", the command "NEWNAME mycopy cp" defines "mycopy" at the alias for the "cp"command. If an alias for a command already exists, then the new alias replaces the old alias. The maximum number of aliases in the alias list should be set to 10 as default.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started