Final Project for the Operative Systems subject. Consists of a command-line interpreter (shell) coded in C. The final version is located in the main.c file. This repository also includes a version without structs for the commands, and also a modified version (with a max number of args in each command).
To compile the project:
gcc -g -c -Wall -Wvla -Wshadow main.c
gcc -g -o shell main.o
./shellIn order to debug and try the shell, there are test scripts in the /tests folder
The lines without redirections can end with 'HERE{'. The command will use the lines written by the user as stdin until '}'
wc -l HERE{
abc
ji
}There is an environment variable called 'result' that contains the status of the last command executed (?$ in UNIX shell). Also, there are included 2 commands: ifok and ifnot.
Ifok will execute the next command if the last command was succesful. On the contrary, ifnot will execute it if the last command was not succesful.
Globbing expansion.