Shell in C
$30-45 USD
Paid on delivery
I need a shell (command line interpreter, allowing the user to interact with the OS), written in C, that can perform the following operations:
-cp (copy a file)
-del (deletes a file)
-host (prints the hostname of the machine
-cd (changes directory)
-clr (clears screen)
-dir (lists the contents within the directory)
-environ (lists the environment settings)
-echo <comment> (displays the comment followed by a new line)
-help (displays a help file listing all of the commands that can be used)
-quit (exits the shell)
More information below.
## Deliverables
I need a shell (command line interpreter, allowing the user to interact with the OS), written in C, that can perform the following operations:
-cp (copy a file)
-del (deletes a file)
-host (prints the hostname of the machine
-cd (changes directory)
-clr (clears screen)
-dir (lists the contents within the directory)
-environ (lists the environment settings)
-echo <comment> (displays the comment followed by a new line)
-help (displays a help file listing all of the commands that can be used)
-quit (exits the shell)
It should be called "myshell"
All programming should be in C, the commands should be programmed in C and they can't just call pre-compiled code.
For example, I DON'T want this:
host()
{
system("hostname");
exit(0);
}
But I DO want something like this:
(this is an echo command, found it on wikipedia)
int echo(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++)
printf("%s%s", argv[i], (i < argc-1) ? " " : "");
printf("\n");
return 0;
}
The shell must be able to take its commands from a batch file, i.e., myshell batchfile. The batch file will contain a set of commands supported by the shell.
In the case of shell executed without a command line the shell must be able to interact with the user through the command line prompt.
All other command line input is interpreted as program invocation that should be done by the shell forking and execing the programs as its own child processes.
All code should be well notated so that I can see what each bit of code does (I want to understand the language)
Project ID: #3261632