A simple shell program in C, akin to the Bash shell, but with a reduced feature set. The goal was to develop a functional shell named smallsh
that executes command line instructions, handles input/output redirection, and manages foreground and background processes.
- Command Execution:
smallsh
executes command line instructions and returns results. - Redirection: Supports redirection of standard input and standard output.
- Foreground and Background Processes: Capable of handling both foreground and background processes.
- Built-in Commands:
exit
: Terminates the shell session.cd
: Changes the current working directory.status
: Displays the exit status of the last executed command.
- Comments: Lines beginning with the
#
character are treated as comments and ignored.
To get started with smallsh
, follow these steps:
- Clone the Repository: Clone this repository to your local machine.
git clone https://github.com/yourusername/smallsh.git
- Navigate to the Project Directory:
cd smallsh
- Compile the Code: Use
gcc
to compile the source code.gcc -o smallsh smallsh.c
- Run the Shell: Execute the shell using the compiled binary.
./smallsh
- Development Environment: Please perform all development work on the designated class server to avoid potential issues on other systems.
- Handling Issues: If you experience problems with runaway processes affecting your access, use the provided page to terminate unwanted processes.
smallsh$ ls -l
smallsh$ cd /path/to/directory
smallsh$ ./myprogram > output.txt
smallsh$ ./myprogram &
smallsh$ exit