{"id":21232520,"url":"https://github.com/essien1990/simple_shell","last_synced_at":"2026-04-16T11:31:06.704Z","repository":{"id":107275741,"uuid":"523535455","full_name":"essien1990/simple_shell","owner":"essien1990","description":"Kalu and i are ALX SE students who worked on this simple shell project using C Language","archived":false,"fork":false,"pushed_at":"2022-08-11T00:37:14.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T02:41:58.545Z","etag":null,"topics":["bash","c","linux","shell","unix"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/essien1990.png","metadata":{"files":{"readme":"README.md","changelog":"history.c","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-11T00:22:36.000Z","updated_at":"2022-08-30T04:08:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b8298a7-b5d9-4424-8f3a-97909b56b2f7","html_url":"https://github.com/essien1990/simple_shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/essien1990/simple_shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essien1990%2Fsimple_shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essien1990%2Fsimple_shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essien1990%2Fsimple_shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essien1990%2Fsimple_shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/essien1990","download_url":"https://codeload.github.com/essien1990/simple_shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/essien1990%2Fsimple_shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31883691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","c","linux","shell","unix"],"created_at":"2024-11-20T23:52:48.104Z","updated_at":"2026-04-16T11:31:06.688Z","avatar_url":"https://github.com/essien1990.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Shell Project ALX Project Using C Language\r\n\r\n## What is the shell?\r\nThe shell is a program that takes commands from the keyboard via the terminal, and gives them to the operating system to perform.\\\r\n**To better understand how the shell actually works, you can read our [Article].**\r\n\r\n## About this project\r\nThis project is a simple version of the linux shell made for [ALX SOFTWARE ENGINERRING] taking part of the \"Simple Shell - Linux and Unix system programming\" Project.\\\r\nIt is created using the **C programming Language** and it can do many functionalities that a real shell does.\r\n\r\n## Essential Functionalities of the Simple Shell:\r\n\u003e Displays a prompt \"#cisfun$ \" and waits for user input.\\\r\n\u003e Runs all commands of type \"executable program\" (ls and /bin/ls).\\\r\n\u003e Runs the following build_in commands: **exit**, **env**, **setenv** and **unsetenv**.\\\r\n\u003e Handles commands with arguments.\\\r\n\u003e Handles the PATH global variable.\\\r\n\u003e Handles The EOF (End Of File) condition.\\\r\n\u003e Handles the Ctrl + C signal -\u003e It doesn't exit the shell\r\n\r\n## Files description\r\n - **AUTHORS** -\u003e List of contributors to this repository\r\n - **man_1_simple_shell** -\u003e Manual page for the simple_shell\r\n - **shell.h** -\u003e Header file\r\n - **shell.c** -\u003e main function\r\n\t- **sig_handler** -\u003e handles the Ctrl + C signal\r\n\t- **_EOF** -\u003e handles the End Of File condition\r\n - **string.c**\r\n\t- **_putchar** -\u003e prints a character\r\n\t- **_puts** -\u003e prints a string\r\n\t- **_strlen** -\u003e gives the length of a string\r\n\t- **_strdup** -\u003e copies a string in a newly allocated memory\r\n\t- **concat_all** -\u003e concatenates 3 strings in a newly allocated memory\r\n - **line_exec.c**\r\n\t- **splitstring** -\u003e splits a string into an array of words\r\n\t- **execute** -\u003e executes a command using execve\r\n\t- **realloc** -\u003e reallocates a memory block\r\n\t- **freearv** -\u003e frees a 2 dimensional array\r\n - **linkpath.c**\r\n\t- **_getenv** -\u003e returns the value of a global variable\r\n\t- **add_node_end** -\u003e adds a node in a singly linked list\r\n\t- **linkpath** -\u003e creates a singly linked list for PATH directories\r\n\t- **_which** -\u003e finds the pathname of a command\r\n\t- **free_list** -\u003e frees the linked list of PATH value\r\n - **checkbuild.c**\r\n\t- **checkbuild** -\u003e checks if a command is a build-in command\r\n - **buildin.c**\r\n\t- **exitt** -\u003e handles the exit buildin command\r\n\t- **_atoi** -\u003e converts a string into an integer\r\n\t- **env** -\u003e prints the current environment\r\n\t- **_setenv** -\u003e Initialize a new global variable, or modify an existing one\r\n\t- **_unsetenv** -\u003e remove a global variable\r\n\r\n****\r\n## :hash: List of allowed functions and system calls for this project\r\n - access (man 2 access)\r\n - chdir (man 2 chdir)\r\n - close (man 2 close)\r\n - closedir (man 3 closedir)\r\n - execve (man 2 execve)\r\n - exit (man 3 exit)\r\n - _exit (man 2 _exit)\r\n - fflush (man 3 fflush)\r\n - fork (man 2 fork)\r\n - free (man 3 free)\r\n - getcwd (man 3 getcwd)\r\n - getline (man 3 getline)\r\n - isatty (man 3 isatty)\r\n - kill (man 2 kill)\r\n - malloc (man 3 malloc)\r\n - open (man 2 open)\r\n - opendir (man 3 opendir)\r\n - perror (man 3 perror)\r\n - read (man 2 read)\r\n - readdir (man 3 readdir)\r\n - signal (man 2 signal)\r\n - stat (__xstat) (man 2 stat)\r\n - lstat (__lxstat) (man 2 lstat)\r\n - fstat (__fxstat) (man 2 fstat)\r\n - strtok (man 3 strtok)\r\n - wait (man 2 wait)\r\n - waitpid (man 2 waitpid)\r\n - wait3 (man 2 wait3)\r\n - wait4 (man 2 wait4)\r\n - write (man 2 write)\r\n****\r\n\r\n## :pencil: USAGE\r\nYou can try our shell by following these steps:\r\n\u003e **Step 1:** Clone our repository using this command, (you need to have git installed on your machine first)\r\n````\r\ngit clone https://github.com/tecnophille/simple_shell\r\n````\r\n\u003e **Step 2:** Change directory to simple_shell:\r\n````\r\ncd simple_shell\r\n````\r\n\u003e **Step 3:** Compile the C files in this way:\r\n````\r\ngcc -Wall -Werror -Wextra -pedantic *.c -o hsh\r\n````\r\n\u003e **Step 4:** Run the shell\r\n````\r\n./hsh\r\n````\r\n**Exiting the shell**\r\nWhen you want to exit the shell, you can use one of the following methods:\r\n\u003e **1: Type the command \"exit\"**\r\n````\r\nexit\r\n````\r\n\u003e **2: Press on Ctrl + D**\r\n\r\n## :warning: Example of Usage\r\n````\r\nubunto@ubuntu:~/OS/simple_shell$ gcc -Wall -Wextra -Werror -pedantic *.c -o hsh\r\nubunto@ubuntu:~/OS/simple_shell$ ./hsh\r\n#cisfun$ echo Hello, This is an example\r\nHello, This is an example\r\n#cisfun$ ls\r\nREADME.md  checkbuild.c  line_exec.c  shell.c  string.c\r\nbuildin.c  hsh\t\t linkpath.c   shell.h\r\n#cisfun$ ^C\r\n#cisfun$ ls -l\r\ntotal 52\r\n-rw-r--r-- 1 ubunto ubunto  3067 Aug 9 04:22 README.md\r\n-rw-r--r-- 1 ubunto ubunto  2183 Aug 9 16:17 buildin.c\r\n-rw-r--r-- 1 ubunto ubunto   574 Aug 9 15:59 checkbuild.c\r\n-rwxr-xr-x 1 ubunto ubunto 18144 Aug 9 04:22 hsh\r\n-rw-r--r-- 1 ubunto ubunto  2091 Aug 9 14:49 line_exec.c\r\n-rw-r--r-- 1 ubunto ubunto  199 Aug 9 14:30 linkpath.c\r\n-rw-r--r-- 1 ubunto ubunto   951 Aug 9 16:09 shell.c\r\n-rw-r--r-- 1 ubunto ubunto  1351 Aug 9 15:58 shell.h\r\n-rw-r--r-- 1 ubunto ubunto  1727 Aug 9 14:30 string.c\r\n#cisfun$ exit\r\nubunto@ubuntu:~/OS/simple_shell$\r\n````\r\n### 👨‍👨‍ Authors:\r\n* **Felix Adeh Essienne** [LinkedIn](https://www.linkedin.com/in/essienne-felix-607a3769) || [Twitter](https://twitter.com/nana_essien) || [github](https://github.com/essien1990)\r\n* **Ifeanyi Kalu** [LinkedIn](https://www.linkedin.com/in/ifeanyi-kalu) || [Twitter](https://twitter.com/fazzythegreat) || [github](https://github.com/fazzy12)\r\n\r\n### 🙏 Acknowledgements\r\n\r\nThis project was written as part of the curriculum for ALX Africa. ALX Africa SE course is a full-stack software engineering program that prepares students for careers in the tech industry using project-based peer learning. For more information, visit (https://www.alxafrica.com/).\r\n\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessien1990%2Fsimple_shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fessien1990%2Fsimple_shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fessien1990%2Fsimple_shell/lists"}