Write your own simple shell. Your shell should prompt the user for...

Question
Write your own simple shell. Your shell should prompt the user for a command, run it, then prompt the user for their next command. If the user types "exit", then the shell should terminate. The shell should ignore Ctrl-C.

There is a parse function that you can use to split up the command line into separate strings. E#xecvp accepts two arguments: the name of the command, and then an array of command-line arguments as strings. The parse() function in accepts the string and returns the array of argument strings.
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h> /* signal */

#define MAX_ARGC 2500
#define MAX_LEN 100

#define EXITS    "exit"

/**
* read input and parse it
* @param file input stream
* @param command array of argument
* @param size number of argument
*/
void parses(FILE * file, char * command [MAX_ARGC], int * size){
    int counter;
    size_t sz;
    char str[MAX_ARGC];
    char *token;                  //split command into separate strings
    int i;
   
    char delim[] = " \n";
    counter = 0;
   
    fgets(str, MAX_ARGC, file);         /* read all line */
   
    for (i = 0; i < strlen(str); i++) {
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.c
Purchase Solution
$43.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 645 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,808+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,701+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,469+ sessions)
2 hours avg response

Similar Homework Solutions