{"id":35323728,"url":"https://github.com/abdulrahman-k-s/simple_shell","last_synced_at":"2026-04-11T17:02:21.302Z","repository":{"id":193254108,"uuid":"687923574","full_name":"Abdulrahman-K-S/simple_shell","owner":"Abdulrahman-K-S","description":"ALX's low-level programming second project. Made with my peer @fadirafik","archived":false,"fork":false,"pushed_at":"2023-10-22T12:45:59.000Z","size":126,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T22:59:39.755Z","etag":null,"topics":["alx","alx-low-level-programming","alx-project","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/Abdulrahman-K-S.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}},"created_at":"2023-09-06T09:34:09.000Z","updated_at":"2023-10-06T15:27:36.000Z","dependencies_parsed_at":"2024-04-23T20:09:43.092Z","dependency_job_id":"8dc241ab-2a8d-4010-8686-d9586920a7a5","html_url":"https://github.com/Abdulrahman-K-S/simple_shell","commit_stats":null,"previous_names":["bebo-k-s/simple_shell","abdulrahman-k-s/simple_shell"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abdulrahman-K-S/simple_shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrahman-K-S%2Fsimple_shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrahman-K-S%2Fsimple_shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrahman-K-S%2Fsimple_shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrahman-K-S%2Fsimple_shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abdulrahman-K-S","download_url":"https://codeload.github.com/Abdulrahman-K-S/simple_shell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abdulrahman-K-S%2Fsimple_shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31687881,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T13:07:20.380Z","status":"ssl_error","status_checked_at":"2026-04-11T13:06:47.903Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["alx","alx-low-level-programming","alx-project","bash","c","linux","shell","unix"],"created_at":"2025-12-31T00:34:11.896Z","updated_at":"2026-04-11T17:02:21.297Z","avatar_url":"https://github.com/Abdulrahman-K-S.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cp align='center'\u003e simple_shell\n\n\u003cbr\u003e\n\n## AUTHORS\nThis file lists all individuals who have contributed content to this repository.\n## man_1_simple_shell\nThis file is a manual page for our simple Unix command line interpreter.\n## C - Simple Shell Project\n### Requirements\n- Allowed editors: `vi`, `vim`, `emacs`\n- All files will be compiled on Ubuntu 14.04 LTS\n- The C programs and functions will be compiled with `gcc 4.8.4` using the flags `-Wall` `-Werror` `-Wextra` and `-pedantic`\n- The code uses the `Betty` style. It will be checked using [betty-style.pl](https://github.com/holbertonschool/Betty/blob/master/betty-style.pl) and [betty-doc.pl](https://github.com/holbertonschool/Betty/blob/master/betty-doc.pl).\n- There will be no more than 5 functions per file, and each file should end in a newline.\n- All header files should be include guarded\n- Only use system calls when necessary\n### Output\n- Unless specified, our program should have the exact same output as `sh` (`/bin/sh`) as well as the exact same error output. The only difference is when we print an error, the name of the program will be equivalent to our `argv[0]` (see below)\n\nExample of error with `sh`:\n```\n$ echo \"qwerty\" | /bin/sh\n/bin/sh: 1: qwerty: not found\n$ echo \"qwerty\" | /bin/../bin/sh\n/bin/../bin/sh: 1: qwerty: not found\n```\nSame error with our program `hsh`:\n```\n$ echo \"qwerty\" | /bin/hsh\n/bin/sh: 1: qwerty: not found\n$ echo \"qwerty\" | ./././hsh\n./././hsh: 1: qwerty: not found\n```\n### List of allowed functions and system calls\n- `access` (man 2 access)\n- `chdir` (man 2 chdir)\n- `close` (man 2 close)\n- `closedir` (man 3 closedir)\n- `execve` (man 2 execve)\n- `exit` (man 3 exit)\n- `fork` (man 2 fork)\n- `free` (man 3 free)\n- `stat` (man 2 stat)\n- `lstat` (man 2 lstat)\n- `fstat` (man 2 fstat)\n- `getcwd` (man 3 getcwd)\n- `getline` (man 3 getline)\n- `kill` (man 2 kill)\n- `malloc` (man 3 malloc)\n- `open` (man 2 open)\n- `opendir` (man 3 opendir)\n- `perror` (man 3 perror)\n- `read` (man 2 read)\n- `readdir` (man 3 readdir)\n- `signal` (man 2 signal)\n- `strtok` (man 3 strtok)\n- `wait` (man 2 wait)\n- `waitpid` (man 2 waitpid)\n- `wait3` (man 2 wait3)\n- `wait4` (man 2 wait4)\n- `write` (man 2 write)\n- `_exit` (man 2 `_exit`)\n- `isatty` (man 3 isatty)\n- `fflush` (man 3 fflush)\n### Compilation\nThe shell should be compiled in this way:\n```\ngcc -Wall -Werror -Wextra -pedantic *.c -o hsh\n```\n### How it should work\nOur shell should work like this in interactive mode:\n```\n$ ./hsh\n($) /bin/ls\nhsh main.c shell.c\n($)\n($) exit\n$\n```\nBut also in non-interactive mode:\n```\n$ echo \"/bin/ls\" | ./hsh\nhsh main.c shell.c test_ls_2\n$\n$ cat test_ls_2\n/bin/ls\n/bin/ls\n$\n$ cat test_ls_2 | ./hsh\nhsh main.c shell.c test_ls_2\nhsh main.c shell.c test_ls_2\n$\n```\n### The simple shell\nWhat our UNIX command line interpreter does:\n- Display a prompt and wait for the user to type a command. A command line always ends with a new line.\n- The command is displayed again each time a command has been executed.\n- The command lines are simple, no semicolons, no pipes, no redirections or any other advanced features.\n- The command lines are made only of one word.\n- If an executable cannot be found, print an error message and display the prompt again.\n- Handle errors.\n- Handle the \"end of file\" condition (`Control+D`)\n- Handle the `PATH`\n- Take the command `exit` that exits the shell.\n- Print current environment with `env`\n- Change the current working directory `cd`\n- Handle special characters: `\"`, `'`, `\\`, `*`, `\u0026`, `#`, `` ` ``\n\nWhat our shell does not have to do:\n- Be able to move the cursor.\n\n\n\u003cbr\u003e\n\n\n## Contributors\n\nAbdulrahman Khaled [Github](https://github.com/Bebo-K-S).\n\nFadi Haddad [Github](https://github.com/fadirafik).\n\n\u003ca href = \"https://github.com/Bebo-K-S/simple_shell/graphs/contributors\"\u003e\n   \u003cimg src = \"https://contrib.rocks/image?repo=bebo-k-s/simple_shell\"/\u003e\n \u003c/a\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulrahman-k-s%2Fsimple_shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdulrahman-k-s%2Fsimple_shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdulrahman-k-s%2Fsimple_shell/lists"}