- Familiarity with system calls in Unix environment.
- Introduction to processes and multi-processing.
- Introduction to signal handling in Unix environment.
It is required to implement a Unix shell program. A shell is simply a program that conveniently allows you to run other programs. The shell supports the following commands:
- The internal shell command "exit" which terminates the shell
- A command with no arguments
Example: ls, cp, rm - A command with arguments
Example: ls –l - A command, with or without arguments, executed in the background using &.
Example: gedit &
Details: In this case, your shell must execute the command and return immediately, not blocking until the command finishes.
Requirements: Show that the opened process will be nested as a child process to the shell program via opening the task manager found in the operating system. Additionally, you have to write in a log file (basic text file) when a child process is terminated (main application will be interrupted by a SIGCHLD signal). So you have to implement an interrupt handler to handle this interrupt and do the corresponding action to it.
- Shell builtin commands
Commands: cd & echo
cd: Cover all the following cases (assume no spaces in path):
* cd
* cd ~
* cd ..
* cd absolute_path
* cd relative_path_to_current_working_directory
echo: Prints the input after evaluating all expressions (assume input to echo must be within double quotations). - Expression evaluation
Commands: export
Details: Set values to variables and print variables values. No mathematical operations is needed.
Export Details: Accept input of two forms, either a string without spaces, or a full string inside double quotations.