First step in the creation of a shell. This project consists in a mini-shell capable of reading and evaluating simple user commands. Trivial lexical analysis and parsing of the command. Searching for the corresponding binary on the machine and execute it, or execute the relevant code in the case of a “built-in” command in the shell.
make
make
: Compiles the files and creates the executableminishell
make clean
: Remove binary files.make fclean
: Deletes the binary files and theminishell
executable file.make re
: Deletes the binary files and theminishell
executable file and recompiles them.
The prompt is displayed as follows:
["shell name"] :: "current directory" ->
The current directory is updated live, each time you change directory, of course, the information is collected from the environment variable PWD
.
The command shall be searched for using the PATH environment variable.
It is possible to specify the paths where the command to execute resides (in case you want to execute a command that does not reside in any directory of the PATH variable, or the variable is not defined).
The parameters of each command are taken into account.
- List the internal variables of the shell via the built-in env.
- Removal of internal and environmental variables, via the built-in unsetenv.
- Creation of environment variables for a single command via the built-in setenv.
~
HOME path of the current user. Is replaced by the HOME path of the current user.