A simple UNIX command interpreter that provides a user interface to access and give orders to the operating system.
- Ubuntu 14.04 LTS
- gcc version 4.8.4
- Clone this repository:
git clone https://github.com/Doniben/simple_shell.git
- Inside the repository, compile.
- Execute:
./hsh
- Or run in non-interactive mode, in this mode:
echo "ls" | ./hsh
gcc -Wall -Werror -Wextra -pedantic *.c -o hsh
- GNU Emacs 24.3.1
- C language
- Run an executable:
$ /bin/pwd
- Run an executable founded in the $PATH environment variable:
$ pwd
- Run a shell built-in:
$ env
All commands and builtins that you can use are in the manual page.
-
main.c - File where all the main functions are called
-
prompt.c - File where are the main functions to display the prompt
read_line
- print the lineparsing_line
- tokenize and analyze the argumentexec_process
- execution of process
-
path.c - program header file
path_av
- communicate the route with the commandph_to_dp
- function to put te path route into a double pointernumber_of_dir
- number of directories in the route of path
-
builtin.c - Builtin functions
_enviro
- function that prints the environmental variablessalto_linea
- Auxiliar function for the use of the command signal
-
own_func.c - helper functions for the builtins
_strcmp
- compare two strings_strcat
- concat two strings_strdup
- a function that duplicates a string_strlen
- function to return the length of a string_putchar
- writes the character to stdout
-
header.c - The header file
-
man_1_simple_shell - Manual page for the simple_shell
-
AUTHORS - List of contributors to this repository