Skip to content

Latest commit

 

History

History
28 lines (27 loc) · 1.12 KB

File metadata and controls

28 lines (27 loc) · 1.12 KB

Shell vlite.1.0

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).

Compilation, tests and usage

To compile the project:

gcc -g -c -Wall -Wvla -Wshadow main.c
gcc -g -o shell main.o
./shell

In order to debug and try the shell, there are test scripts in the /tests folder

Optional features added.

Here document

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
}

Result environment variable (Ifok / Ifnot)

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

Globbing expansion.