Skip to content

Repository files navigation

Shell

This repository contains our own simple version of the shell, a command line interpreter written in C language.

The Flowchart shows how the program was built.

Files of this repository

FileDescription
man_1_simple_shell.1It is the manual for using the shell. Contains a description, ways for invocation, and some examples of builtins and executables that can be used inside the command line interpreter.
shell.hIt is a header file that contains all the c libraries needed for the program, the description and prototypes of all the functions, structures, builtins, printing functions, and helpers.
shell.cIt contains the entry point of the program, where the execution begins. It shows the prompt and receives the characters written in the command line.
get_line.cIt gets the string written from the command line and save it in a predefined buffer, allocating enoght space.
str_tok.cIt cuts the string in parts.
tokenize.cIt save the parts to be analyzed later.
builtins_list.cIt compare the command with a list of builtins, and if there is a match, It calls the associated builtin.
builtins.cIt contains the code of the builtins included in the program.
find_in_path.cIt analyze the global variable path.
execute.cIt tries to execute the string as a command.
helpers_string.cIt contains some functions that help the main functions to process the strings.
helpers_printing.cIt contains some functions that help to print content in the standar error and the standar output.

Compilation

gcc-Wall-Werror-Wextra-pedantic*.c

Example to use it

simple_shell$./a.outdali<3lsREADME.mddali<3exitsimple_shell$

Environment

This project has been tested on Ubuntu 14.06.6 LTS

Authors

Contributors

Languages