24th September 2021
- Specifications
- Key features
- Constraints
- Instructions
- Mindmap/Overview
- Some specifications
- Examples of some functions
- Works on LINUX
- Written using C++ (POSIX based system) using g++ 9.3.0 for Ubuntu
- MiniShell simulates bash and tries to include a reasonable subset of commands.
- printenv lists all environment variables.
- setenv
(variable_name = variable_value)
changes value of variable_name as per requirement. - Any particular environment variable can be seen from writing the name of that variable or writing echo $VAR where VAR is variable name.(shown later too.)
- Read mode, Write mode, Append mode
however due to limitations of posix based compiler having access to the internal workings of an extended system,some natural functions which are internal to a shell but not to a C++ program may not work.Inspite of this, the following have been explicitly defined as internal commands to without using execvp and work perfectly:
- help
- cd
- setenv *
- exit (or quit or x)
- history
- printenv
- clear
*PLEASE NOTE : setenv works in the following format:setenv variable_name=new_variable_value
If this is successful, you should get a "VALUE CHANGED" prompt and the same can be checked by writing the variable name in the terminal which will output the value of the environment variable.
On recognising piping, the command is executed directly
On recognising piping, the command is executed directly,multi-level redirection is restricted.
Redirection is checked for only if piping is not present
- Compile with g++ or gnu post 9.2
- Run with linux based OS
- The Shell boots up with the following screen giving developer credits and information and welcoming user to the shell.
- Blank Lines are handled quite well, they don’t get recorded in history.
- Redirection : MAKE SURE TO type both the command with no space before and after the redirection symbol (> , <, >>)
- Wrong commands give prompt to appropriate errors.
- setenv : type command as setenv (environment variable) = (new value) Make sure you use appropriate spacings.
- Exiting deletes history file(with exit or quit or x)
- help