{"id":17674406,"url":"https://github.com/bernoussama/simple_shell","last_synced_at":"2026-02-15T14:36:57.433Z","repository":{"id":187752249,"uuid":"677360403","full_name":"bernoussama/simple_shell","owner":"bernoussama","description":"Simple linux shell","archived":false,"fork":false,"pushed_at":"2025-01-22T15:56:00.000Z","size":149,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T13:04:34.526Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/bernoussama.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-08-11T11:30:40.000Z","updated_at":"2025-01-22T15:56:04.000Z","dependencies_parsed_at":"2023-08-12T02:56:46.353Z","dependency_job_id":"4cadbed9-52eb-4158-bce8-10f0347c0903","html_url":"https://github.com/bernoussama/simple_shell","commit_stats":null,"previous_names":["0ussamabernou/simple_shell","bernoussama/simple_shell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernoussama%2Fsimple_shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernoussama%2Fsimple_shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernoussama%2Fsimple_shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bernoussama%2Fsimple_shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bernoussama","download_url":"https://codeload.github.com/bernoussama/simple_shell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717246,"owners_count":21150389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-24T07:06:57.942Z","updated_at":"2026-02-15T14:36:52.396Z","avatar_url":"https://github.com/bernoussama.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cimg src=\"https://cdn.jsdelivr.net/gh/devicons/devicon/icons/c/c-original.svg\" width=\"200\" \u003e\n\n# 0x16. C - Simple Shell\n\nA shell is a command-line interface that executes commands and manages processes. This is our own POSIX compliant shell that's capable of interpreting shell commands, running external programs and builtin commands like cd, pwd, echo and more.\n\n\n## More Info\n\n### Output\n\n-   Unless specified otherwise, your program  **must have the exact same output**  as  `sh`  (`/bin/sh`) as well as the exact same error output.\n-   The only difference is when you print an error, the name of the program must be equivalent to your  `argv[0]`  (See below)\n\nExample of error with  `sh`:\n\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$\n```\n\nSame error with your program  `hsh`:\n\n```\n$ echo \"qwerty\" | ./hsh\n./hsh: 1: qwerty: not found\n$ echo \"qwerty\" | ./././hsh\n./././hsh: 1: qwerty: not found\n$\n```\n\n### List of allowed functions and system calls\n\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-   `_exit`  (man 2 _exit)\n-   `fflush`  (man 3 fflush)\n-   `fork`  (man 2 fork)\n-   `free`  (man 3 free)\n-   `getcwd`  (man 3 getcwd)\n-   `getline`  (man 3 getline)\n-   `getpid`  (man 2 getpid)\n-   `isatty`  (man 3 isatty)\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-   `stat`  (__xstat) (man 2 stat)\n-   `lstat`  (__lxstat) (man 2 lstat)\n-   `fstat`  (__fxstat) (man 2 fstat)\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\n### Compilation\n\nOur shell is compiled this way:\n\n```\ngcc -Wall -Werror -Wextra -pedantic -std=gnu89 *.c -o hsh\n```\n\n### Testing\n\nOur shell work like this in interactive mode:\n\n```\n$ ./hsh\n($) /bin/ls\nhsh main.c shell.c\n($)\n($) exit\n$\n```\n\nBut also in non-interactive mode:\n\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\n### Concepts\n\n-   [Everything you need to know to start coding your own shell](https://github.com/0ussamaBernou/simple_shell/blob/master/MD/exercices.md)\n-   [Approaching a Project](https://github.com/0ussamaBernou/simple_shell/blob/master/MD/project.md)\n\n\n## Resources\n\n\n-   [Unix shell](https://en.wikipedia.org/wiki/Unix_shell \"Unix shell\")\n-   [Thompson shell](https://en.wikipedia.org/wiki/Thompson_shell \"Thompson shell\")\n-   [Ken Thompson](https://en.wikipedia.org/wiki/Ken_Thompson \"Ken Thompson\")\n-   **Everything you need to know to start coding your own shell**  concept page\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernoussama%2Fsimple_shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbernoussama%2Fsimple_shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbernoussama%2Fsimple_shell/lists"}