{"id":16260237,"url":"https://github.com/wiwichips/squish","last_synced_at":"2025-08-16T12:15:32.669Z","repository":{"id":132920904,"uuid":"294951094","full_name":"wiwichips/squish","owner":"wiwichips","description":"Lightweight UNIX commandline shell for MacOS \u0026 Linux","archived":false,"fork":false,"pushed_at":"2020-10-07T00:28:58.000Z","size":116,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T10:18:48.623Z","etag":null,"topics":["c","linux","mac","pipe","shell"],"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/wiwichips.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":"2020-09-12T13:38:53.000Z","updated_at":"2024-09-16T20:37:52.000Z","dependencies_parsed_at":"2023-07-19T23:20:20.175Z","dependency_job_id":null,"html_url":"https://github.com/wiwichips/squish","commit_stats":{"total_commits":37,"total_committers":1,"mean_commits":37.0,"dds":0.0,"last_synced_commit":"61ae13e41f41c769c7d0cb18b2f2e724a0df3d3d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiwichips%2Fsquish","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiwichips%2Fsquish/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiwichips%2Fsquish/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiwichips%2Fsquish/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiwichips","download_url":"https://codeload.github.com/wiwichips/squish/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247855608,"owners_count":21007613,"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":["c","linux","mac","pipe","shell"],"created_at":"2024-10-10T16:06:51.519Z","updated_at":"2025-04-08T13:51:13.272Z","avatar_url":"https://github.com/wiwichips.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SQUISH\r\nSuperior Quality Unbeatable Interprocess (communication) Shell, or \"squish\", is a shell that supports running processes, piping between processes, handle redirection, variable globbing, cd and exit. \r\n## How to Compile and Run\r\n```bash\r\nmake\r\n./squish\r\n```\r\n## How errors are handled\r\n* When entering a command that doesn't exist, squish will ouput \"name: command not found\". \r\n* The exit status of the command will be outputted if running a single command. \r\n## Piping algorithm\r\nProcesses are piped recursively backwards from the last command. The recursive base case is when there is only one command left to be exec'd.\r\n\r\nFor ex. ``p1 | p2 | p2`` can be represented as:\r\n```\r\n       squish\r\n         /\\\r\n        /  \\\r\n       /\\   p3\r\n      /  \\\r\n     p1  p2\r\n```\r\nPseudo-code follows as such:\r\n```c\r\nipc (tokens, nTokens) \r\n{\r\n  if ( nTokens == 1 ) {\r\n    fork new process\r\n    exec ( tokens[0] )\r\n    return\r\n  }\r\n\r\n  fork new process\r\n  if ( pid == 0 ) {\r\n    replace stdout with write end of pipe\r\n    ipc (tokens, --ntokens)\r\n  }\r\n\r\n  fork new process\r\n  if ( pid == 0 ) {\r\n    replace stdin with read end of pipe\r\n    exec ( tokens[nTokens] )\r\n  }\r\n}\r\n```\r\n## File Structure\r\n### Tokenization Files by AHW\r\nsquish_main.c\r\nsquish_run.c\r\nsquish_tokenize.c\r\n### \"Built-in\" CD and exit\r\nw_change_dir.c\r\nw_exit.c\r\n### Globbing\r\nw_glob.c\r\n### Piping and redirection\r\nw_pipe.c\r\nw_redirection.c\r\n### Input parser\r\nw_run.c\r\n### Exec wrapper\r\nw_run_command.c\r\n\r\n## Works Cited\r\nSome of the code is copied from the cis-3050 c examples from the linux.socs server. Wherever that is the case, a comment block will be included above the code snippit.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiwichips%2Fsquish","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiwichips%2Fsquish","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiwichips%2Fsquish/lists"}