This is a very small implementation of Bash using Flex and Bison in C. This implementation has nowhere near the amount of features as the original Bash but it does have a few of the key features.
- -d or --debug ---- Activates verbose mode
- -f or --fdebug --- Activates Flex debugging
- -s or --start ---- Processes the resource file at the beginning of execution
- -l or --log ------ Enables log keeping of commands entered
- UID ----- Get the user's ID Syntax UID
- PID ----- Get the current processes' ID Syntax PID
- PPID ---- Get the parent of the current processes' ID Syntax PPID
- NAME ---- Get the user's username Syntax NAME
- WD ------ Get the current working direction Syntax WD
- HD ------ Get the home directory Syntax HD
- INFO ---- Displays the user's information Syntax INFO
- EXIT ---- Exit the application Syntax EXIT
- HOME ---- Go to the home directory Syntax HOME
- UP ----- Go up in the directory heirarchy Syntax UP
- PROMPT - Change the diplayed prompt Syntax PROMPT {PROMPT FLAG}
- RUN ---- Run a command file Syntax RUN {FILE NAME}
- DOWN --- Go down to a directory within the current directory Syntax DOWN {DIRECTORY NAME}
- CLEAR -- Clear the terminal screen Syntax CLEAR
- GO ----- Go to a directory Syntax GO {DIRECTORY PATH}
- SET ---- Set the value of an environment variable Syntax SET {ENV. VARIABLE NAME} {VALUE}
- DEBUG -- Toggle Debug Mode Syntax DEBUG
- TASKS -- Display a list of all child processes Syntax TASKS
- HOSE --- Kill all children processes or a specific process if the ID is given Syntax HOSE Syntax HOSE {PROCESS ID}
A process can be executed simply by entering it's name.
The following is a list of modifiers that can be applied to either commands or files
-
----- Redirect all output from the first into the second Syntax {PROCESS} > {FILE}
- < ----- Redirect all input from the second into the first Syntax {PROCESS} < {FILE}
- | ----- All output from the first process is directed into the second process Syntax {PROCESS} | {PROCESS}
- & ----- Forces the process to run in the background Syntax &{PROCESS}
The following values are flags. Any value below the highest value will produce a combination of these prompts. The prompts are appended from this list starting from top to bottom.
- Default
- Environment Variable
- Basename
- Hostname
- Username
!IMPORTANT! This program will only compile on Linux due to its Fork function calls. This section of the code will need to be changed in order for it to run on a Windows machine.
The provided Makefile will compile the program correctly.
After compilation, start the program. A terminal will appear and from here you will be able to enter commands and proccesses.