Simple shell that can manage command execution, piping of commands, and background execution.
First, the user inputs a command line. Next, the lexer tokenizes the raw command. After that, the command parser transforms all the tokens into different commands. The process parser then transforms the commands into processes that are ready to be executed with or without pipes. Finally, the executor launches all the processes.
- reader
- lexer
- command_parser
- process_parser
- executor
- Application
- Manage pipe left pipe right and double pipe
- Manage background execution
- Navigate with cd
- Cursor movement left and right
- History of command in ram
- History of command in HD
- Coloration Data
- Add a module to open a new windows like gnome-terminal
- Display all information for the user (current directory , User name, Machine name)
- autoCompletion Command
- Builtin function all implemented
- launch_process --> O(2n)
- setup_process --> O(n)
- read_command --> O(n²)
- initReader --> O(n²)
- freeReader --> O(n)
- load_history --> O(6)
- Init_command_parser --> O(2)
- parse_command --> O(2n)
- parse_simple_command --> O(2n)
- lexer_error --> O(n)
- update_number_word --> O(n)
- split_command_args --> O(n²)
- create_token --> O(n)
- create_process --> O(n)
- create_command --> O(6)
- free_all --> O(n²)
- free_token --> O(1)
- free_process --> O(n)
- free_command --> O(n)
When running and executing a simple command, such as "cat Makefile", the program employs approximately 20,034 bytes of memory through 40 allocations. When running and executing a more complex command, such as "cat Makefile | grep e | grep rm", the program employs approximately 20,243 bytes of memory through 70 allocations.
According to Valgrind memory check, the program does not have any memory leaks. All memory allocated in the heap is properly freed.
- IDE : Visual studio code
- Debugger : gdb and Visual studio code Debugger (70/30)
- Memory check : Valgrind
- Compiler : mingw
- Operating System : Ubuntu(64bit)
- Tools of Updating and Versionning : Git
- Diagram : Excalidraw
for dedicating his time to testing the limits of the terminal and for identifying flaws in both the code and its usage. His assistance in structuring and improving for the terminal from a project management and programming perspective has been invaluable. Thanks you Jérôme.
