A user-defined interactive shell program that can create and manage new processes.
C-Shell supports the following features :
- A prompt that displays username, systemname and current working directory.
- Builtin Commands:
pwd,cd,echo,ls,pinfo,history,discover - All other System Commands (with and wihout arguments). This however is not implemented manually and the given shell is emulated.
- Process management (executing foreground and background) processes.
In the source directory
- Run the make command.
- Run ./a.out to start the shell.
- Enter exit to exit the shell.
-
The directory from which the shell is invoked is the home directory of the shell, represented by
~. -
C-Shell supports
;separated list of commands. C-Shell also handles random multipletabsandspacesin the command. -
PromptFor every next command a prompt of the format<username@systemname:curr_dir>is printed.
-
Apart from basic functionality
cdcommand supports multiple flags.,..,-,~. More than one command-line arguments are not allowed.cdwith no flags or arguments cd into home directory. -
echocommand displays the line of text/string that is passed as a command line argument. -
pwdcommand prints the path of the current working directory. -
lscommands with multiple flags-a,-l, multiple directory/file names. Handles arguments in any order. -
pinfoprints process related information.pinfoaccepts one command line argument that is PID and prints the process info of the givenPID. With no command-line arguments, it prints the process info of theshell programitself. Process info printed includes,pid,process status,virtual memory (in kB),executable path.+in process status signifies that the process is running inforeground. -
discoverThis is a command used to search in a given directory. Discover command emulates the basics of the find command. It has optional flags like -d searches for all directories and -f ,searches for all files. e.g. isdiscover <target_dir> <type_flags> <file_name> -
historycommand prints the last10commands executed by the shell across all sessions.historyaccepts a positive integer (sayn)as a command line argument and prints the last n commands executed by the shell across all sessions. Atmax, the shell stores20commands in history.
Other than the builtin commands, C-Shell executes all other system commands either in foreground or background. It supports the & operator which lets a program run in the background after printing the pid of the newly created process. Running a process in background implies that the shell will spawn that process and doesn't wait for the process to exit. It will keep taking other user commands. SeaShell can handle multiple background processes at a time. This implies that your shell will spawn that process and doesn't wait for the process to exit. It will keep taking other user commands. When the background process exits the shell, it display the appropriate message to the user.
- Each command is no longer than 200 characters.
- There are no more than 200 background processes running at a time.