The shell will give a prompt for the user to type in a command, take the command, execute it, and then give the prompt back for the next command (i.e., actually give the functionality of a shell).
-
Give a prompt (like the $ prompt you get in Linux) for the user to type in a command. The prompt should have the current working directory name (full path) followed by the “>” sign (for ex., /usr/home/agupta/temp>).
-
The builtin commands are: cd
pwd mkdir rmdir ls -option (-l option supported) cp file1 file2 (copy of directory supported) exit -
Other files other than this are executed using exec family of commands.
-
Supports background execution of commands. (using &)
-
Supports redirection (< and > also together)
-
Supoorts piping upto 3 stages. (a.out | b.out | c.out)
To run execute the following commands:
cc shell.c -o shell cc run.c ./a.out