Question: 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.







// 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
