To build and run the shell:
sudo apt-get update
sudo apt-get install cmake
cmake .
make
./output/main
c++17 required
Theory:
-
The basic shell perform these basic operations:
- Load config files
- Run REPL loop
- Clean up memory to prevent leakage.
-
In the Loop part following operations are performed:
- Read the commands entered by the user.
- It will parse the commands so computer can understand the commands.
- Execute the commands.
- All Linux Commands are supported.
- Batch Mode done (Use "rsh filename.rsh" \\ Only .rsh files allowed)
- Git Branch, Username, PC name and current directory display during input prompt.
- "exit" can be used to exit the shell and revert to default linux shell.
- pipes ('|') and redirections ('<' or '>' or '>>') supported.
- "history" command can be used to list all the commands used in current shell session.
- Aliases not yet implemented.
- Commands containing string (" ") may not function properly.
- Basic Text editing while entering command is supported.
- Command History access using ↑ and ↓ arrow key.(Limited to current shell session only)
- Tab Auto-Completion during input is supported.
- Basic Arithmetic Operation can be performed using "calc [expresssion]".
(Here expression is any mathematical expression without a space) - "google " can be used to google meaning of any word.
(Note: An active Internet Connection is required to run this command.)
- "tutorial" command be used to run tutorial content and learn about basic shell and git commands inside shell.
- "tutorial level [level-number]" can be used to access practice levels and find the hidden flag using shell commands.
- "tutorial level [level-number] password" can be used to submit the hidden flag in grading software to pass that level.
Errors and Solutions:
-
If cmake . fails with message :
"Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the"
,then run command
sudo apt-get install libssl-dev
on your terminal(tested for ubuntu 18.04 LTS)