{"id":26892415,"url":"https://github.com/kitswas/c-shell","last_synced_at":"2026-02-07T21:01:09.530Z","repository":{"id":134010703,"uuid":"561298485","full_name":"kitswas/C-shell","owner":"kitswas","description":"A shell written in C.","archived":false,"fork":false,"pushed_at":"2024-12-05T17:50:52.000Z","size":723,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-03T22:30:00.475Z","etag":null,"topics":["c","cmake","command-line","shell","unix-shell"],"latest_commit_sha":null,"homepage":"https://kitswas.github.io/C-shell/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kitswas.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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-03T11:49:42.000Z","updated_at":"2024-12-06T01:57:58.000Z","dependencies_parsed_at":"2025-03-31T22:51:12.356Z","dependency_job_id":"f3db240d-1e20-4ac4-a074-58a126fe5aca","html_url":"https://github.com/kitswas/C-shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kitswas/C-shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitswas%2FC-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitswas%2FC-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitswas%2FC-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitswas%2FC-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitswas","download_url":"https://codeload.github.com/kitswas/C-shell/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitswas%2FC-shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29208176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T20:33:12.493Z","status":"ssl_error","status_checked_at":"2026-02-07T20:30:47.381Z","response_time":63,"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":["c","cmake","command-line","shell","unix-shell"],"created_at":"2025-03-31T22:51:07.641Z","updated_at":"2026-02-07T21:01:09.411Z","avatar_url":"https://github.com/kitswas.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# C-shell\r\n\r\nA shell written in C. For educational purposes. [View Source.](https://github.com/kitswas/C-shell)\r\n\r\n\u003e [!CAUTION]\r\n\u003e Warranty NOT included. Use at your own risk.\r\n\r\n## How it works\r\n\r\nHere's what happens when you write something and press enter after the prompt:\r\n\r\n```bash\r\nsleep 5 \u0026; echo \"Hello, World!\" | wc -c\r\n```\r\n\r\n1. The above input will be split up at `;` into two jobs (also known as pipelines or process groups).\r\n2. Each job will be executed sequentially in a separate process. An `\u0026` at the end of a job will run the pipeline in the background.\r\n    - *e.g.* The first job will run `sleep 5` in the background.\r\n    - *e.g.* The second job will run `echo \"Hello, World!\" | wc -c`.\r\n3. Each job will be split up at `|` into a series of commands.\r\n4. Each command will be spawned in a separate process.  \r\n    - *e.g.* The first command in the second job will run `echo \"Hello, World!\"`.\r\n    - *e.g.* The second command in the second job will run `wc -c`.\r\n5. The output of one command will be piped to the input of the next command.\r\n6. The output of the last command in the job will be printed to the console.\r\n\r\n### Pitfalls to avoid\r\n  \r\n- **Some shell built-ins like `cd`, `cls`, `exit` and `jobs` are executed in the top-level shell process due to their nature.**  \r\n  - *e.g.* `cd ..` will change the directory of the shell process.\r\n  - *e.g.* `exit` will exit the shell process.\r\n  - If found at the beginning of a job, the rest of the pipeline will not be executed.  \r\n  - If found in the middle of a pipeline, the shell will complain about the command not being found.\r\n\r\n- **The redirection operators `\u003e`, `\u003e\u003e` and `\u003c` must be space separated from the command and the file name.**  \r\n  - *e.g.* `echo \"Hello, World!\" \u003e file.txt` is valid.\r\n  - *e.g.* `echo \"Hello, World!\"\u003efile.txt` is invalid.\r\n\r\n## Setting up your workspace\r\n\r\nThis project has a [.editorconfig file](https://editorconfig.org/) to enforce project level coding standards.  \r\nCLion has built-in support,\r\nVSCode requires [a plugin](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig).\r\n\r\n## How to run\r\n\r\n\u003e [!IMPORTANT]\r\n\u003e Requires a POSIX compliant system.\r\n\r\nThis project requires [CMake](https://cmake.org/) to build.\r\nYour IDE (VSCode or CLion) should automatically detect the CMakeLists.txt file and build the project.\r\nInstall extensions for CMake support if prompted.  \r\nIf you are using the command line, you can run the following commands:\r\n\r\n```bash\r\ncmake -B build\r\ncmake --build build --config Release\r\n./build/cshell\r\n```\r\n\r\n## Generating and Viewing Documentation\r\n\r\nThis project uses [Doxygen](https://www.doxygen.nl/index.html) to generate documentation.  \r\nIf Doxygen is available on your system,  \r\nYou can generate the documentation by running the following command:\r\n\r\n```bash\r\ndoxygen Doxyfile\r\n```\r\n\r\nThis repository also has an automated workflow to generate documentatation via Github Actions.  \r\n\r\nThe generated documentation can be viewed at [/docs](./docs/index.html).\r\n\r\n```bash\r\nopen docs/index.html # or open the file from the OS file manager\r\n```\r\n\r\n```bash\r\npushd docs ; python3 -m https.server 9999; popd # if you have python installed and want to use a server\r\n```\r\n\r\nA good starting point to explore the codebase is the [file listing page](./docs/files.html).\r\n([files.html](files.html) if you are viewing this in a browser)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitswas%2Fc-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitswas%2Fc-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitswas%2Fc-shell/lists"}