lianshell is a standalone procedurally designed UNIX-based shell program that supports the following features:
- Support for built-in commands including:
- changing working directory
- modifying environment variables
- killing all subprocesses
- Runs external programs from any specified location in the file system
- Sequential execution of multiple processes
- Redirection of output from a process to a file
- Run processes in the background
- Implement piping of output from one program to another
- Handles signal interrupts, including SIGINT and SIGTSTP.
- More signal handling
- Auto-completion of commands
- Use ncurses
- TERM environment variable needs to be set
- chdir() : to change working directory
- fork() : to create a subprocess
- execve() : to execute a process
- _exit() : to exit a process
- wait() : to wait for a process to terminate
- open() / close() : to open or close a file descriptor
- dup2() : duplicate a file descriptor to another
- pipe() : establish a pipe between two processes
- kill() : send a signal to a process
lianshell was tested by running various commands individually as well as in combination with other commands. Valgrind was used to test for memory leaks in the heap and stack memory. htop and pstree were also used to maintain subprocess construction and destruction.
- StackOverFlow
- TutorialsPoint
- eclass CMPUT 379 slides and lab examples