Construct a rudimentary implementation of a shell this will


Assignment

Construct a rudimentary implementation of a shell. This will require knowledge of everything that we've learned so far (string manipulation, memory model) as well as a solid understanding of a powerful Unix primitive: the process.

At its core, the shell is simply an overglorified infinite loop. On each iteration, it prints a prompt, reads a command (from stdin) and then carries out various actions based on the command received.

Prompt

The prompt has been provided for you. You are allowed to change it, so long as the beginning of the prompt consists of the shell's PID surrounded by stache tags.

Input

User input has also been taken care of for you. This is done using the getline() function. getline() is very powerful in that it is capable of reading in a buffer of arbitrary size and will allocate space accordingly. You have to make sure to free this space, however!

After input has been received, it must be tokenized on spaces so that you may effectively deal with the command.

Commands

There are two types of commands: builtins and non. Builtin commands are handled directly by the shell executable itself. Non-builtin commands must be handled by external executables.

The Files

You have been provided with shell.c which provides you with a rudimentary shell. It does not actually do anything other than loop and collect user input.

You do not need a header file in this assignment, although you certainly may provide one if you wish.

Solution Preview :

Prepared by a verified Expert
Computer Engineering: Construct a rudimentary implementation of a shell this will
Reference No:- TGS0659643

Now Priced at $40 (50% Discount)

Recommended (91%)

Rated (4.3/5)