- Write a simple UNIX command interpreter.
| File | Task |
|---|---|
| AUTHORS | File with all the people who have contributed to the content of the repository |
| counter_commands.c | finds the number of commands |
| doub_pointer_comm.c | creates a double-pointer array that holders pointers |
| error_msg.c | prints error messages for certain fails |
| exec_path_direct.c | creates a double pointer array of all your directories |
| free_double_pointer.c | frees double pointers (user's command, arrays) |
| get_enviro.c | finds and returns a copy of the environment variable |
| help_funct_strings.c | contains the string handling functions |
| main.c | hold entrance into the program |
| man_1_simple_shell | the manual page for our simple shell program |
| print_enviro.c | prints all of the environment variables to the output |
| README.md | description about the content and functionality of the project |
| shell.h | header with libraries and prototypes |
| signal.c | handles signals and write the prompt |
| Directory Name | Description |
|---|---|
| simple_shell | Write a simple UNIX command interpreter |
- Language: C
- OS: Ubuntu 14.04 LTS
- Compiler: gcc 4.8.4
- Style guidelines: Betty style
Install and Compile
$ git clone https://github.com/jhonnjc15/simple_shell.git
$ cd simple_shell
$ gcc -Wall -Werror -Wextra -pedantic -Wno-format *.c -o simple_shell
Non-Interactive Mode
$ echo "pwd" | ./simple_shell
/home/pgomez/simple_shell
Interactive Mode
$ ./simple_shell
$ ls -lrth
total 192K
-rw-rw-r-- 1 pgomez pgomez 201 Apr 3 14:32 AUTHORS
-rw-rw-r-- 1 pgomez pgomez 194 Apr 7 23:42 signal.c
-rw-rw-r-- 1 pgomez pgomez 939 Apr 7 23:42 shell.h
-rw-rw-r-- 1 pgomez pgomez 369 Apr 7 23:42 print_enviro.c
-rw-rw-r-- 1 pgomez pgomez 862 Apr 7 23:42 man_1_simple_shell
-rw-rw-r-- 1 pgomez pgomez 2.4K Apr 7 23:42 main.c
-rw-rw-r-- 1 pgomez pgomez 917 Apr 7 23:42 help_funct_strings.c
-rw-rw-r-- 1 pgomez pgomez 2.3K Apr 7 23:42 get_enviro.c
-rw-rw-r-- 1 pgomez pgomez 348 Apr 7 23:42 free_double_pointer.c
-rw-rw-r-- 1 pgomez pgomez 839 Apr 7 23:42 exec_path_direct.c
-rw-rw-r-- 1 pgomez pgomez 359 Apr 7 23:42 error_msg.c
-rw-rw-r-- 1 pgomez pgomez 891 Apr 7 23:42 doub_pointer_comm.c
-rw-rw-r-- 1 pgomez pgomez 504 Apr 7 23:42 counter_commands.c
-rw-rw-r-- 1 pgomez pgomez 1.7K Apr 8 00:34 README.md
-rwxrwxr-x 1 pgomez pgomez 14K Apr 8 00:34 simple_shell
$
Opens our manpage for more information
$ ./man_1_simple_shell
$ man 1 simple_shell
$
Stop and return to your original shell
$ exit
pgomez@ubuntu14:~/simple_shell$
At this time, there are no known bugs.
All files are formatted according to Betty style, checked with betty-style.pl and betty-doc.pl All header files are protected