{"id":24026889,"url":"https://github.com/shan18/simple-shell","last_synced_at":"2026-04-15T20:04:17.154Z","repository":{"id":140051757,"uuid":"418316121","full_name":"shan18/Simple-Shell","owner":"shan18","description":"A simplified version of the Unix shell.","archived":false,"fork":false,"pushed_at":"2022-01-02T07:16:37.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T16:56:36.891Z","etag":null,"topics":["c","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shan18.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-18T02:27:10.000Z","updated_at":"2022-01-02T08:14:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"3edd7c45-810b-4fa1-98d7-cb920666d195","html_url":"https://github.com/shan18/Simple-Shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shan18%2FSimple-Shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shan18%2FSimple-Shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shan18%2FSimple-Shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shan18%2FSimple-Shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shan18","download_url":"https://codeload.github.com/shan18/Simple-Shell/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240783130,"owners_count":19856780,"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","shell","unix"],"created_at":"2025-01-08T16:51:03.106Z","updated_at":"2026-04-15T20:04:17.072Z","avatar_url":"https://github.com/shan18.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Shell\n\nThis is a very simplified version of the Unix shell.\n\n## Compiling and Usage\n\nTo compile the project, run the command\n\n```\n$ make\n```\n\nTo start using the shell, run the executable file generated after compiling\n\n```\n$ ./shell\n```\n\n## Supported Features\n\nThe shell supports the following features\n\n### Built-in Commands\n\nThe shell contains four built-in commands\n\n- **`cd [dir]`**: For changing directories.\n- **`exit`**: To terminate the shell.\n- **`jobs`**: Prints a list of currently suspended jobs to `STDOUT`.\n- **`fg [index]`**: Resumes a job in the foreground.\n\nMore details about the `jobs` and the `fg` commands are given below.\n\n### Running External Programs\n\nAn external program can be specified by either an **absolute path**, a **relative path**, or **base name only**.\n\nIf only the base name of the command is specified, the shell searches for the program under `/bin` and `/usr/bin` (in such order). For example, if the user enters `ls`, the shell first tries `/bin/ls`, if that fails then `/usr/bin/ls` is tried.\n\n### I/O Redirection\n\n#### Input Redirection\n\nThe **standard input** (`STDIN`) can be redirected using `\u003c`. For example:\n\n```\n[user dir]$ cat \u003c input.txt\n```\n\n#### Output Redirection\n\nThe **standard output** (`STDOUT`) can be redirected using `\u003e` and `\u003e\u003e`. If the output file already exists, redirecting with `\u003e` will **overwrite** the file, whereas `\u003e\u003e` will **append** to the existing file. For example:\n\n```\n[user dir]$ ls -l \u003e output.txt\n[user dir]$ ls -l \u003e\u003e output.txt\n```\n\n#### Pipe\n\nA pipe (`|`) can be used to connect the standard output of the first program to the standard input of the second program. For example:\n\n```\n[user dir]$ cat shell.c | grep main | less\n```\n\n### Suspending and Resuming Processes\n\nIf a child process (_job_) has been suspended via `Ctrl-Z` or a `SIGTSTP` or `SIGSTOP` signal, the shell will keep a record of it so that the child can be resumed later.\n\nTo check the list of currently suspended jobs, the `jobs` command can be used. It prints the information in the following format: `[index] command`. For example\n\n```\n[user dir]$ jobs\n[1] cat\n[2] top | cat\n[3] cat \u003e output.txt\n[user dir]$ _\n```\n\nThe list printed above is sorted by the time each job is suspended (oldest first).\n\nTo resume a suspended job, the `fg` command can be used. It takes exactly one argument: the job index, which is the number in the bracket printed by the `jobs` command. For example\n\n```\n[user dir]$ jobs\n[1] cat\n[2] top | cat\n[3] cat \u003e output.txt\n[user dir]$ fg 2\n```\n\nThis command would resume `top | cat` in the foreground.\n\n## Contact/Getting Help\n\nIf you need any help or want to report a bug, raise an issue in the repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshan18%2Fsimple-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshan18%2Fsimple-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshan18%2Fsimple-shell/lists"}