{"id":16734892,"url":"https://github.com/vopaaz/v-shell","last_synced_at":"2026-05-15T18:33:07.027Z","repository":{"id":106209774,"uuid":"193311737","full_name":"Vopaaz/V-Shell","owner":"Vopaaz","description":"A Very basic Shell. Course Project Option 1 for Computer System Architechture, Professor Mao, Tsinghua SEM.","archived":false,"fork":false,"pushed_at":"2020-03-02T06:18:14.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T09:42:07.401Z","etag":null,"topics":["c","shell"],"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/Vopaaz.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":"2019-06-23T05:53:23.000Z","updated_at":"2020-03-02T06:18:17.000Z","dependencies_parsed_at":"2023-03-30T06:22:10.808Z","dependency_job_id":null,"html_url":"https://github.com/Vopaaz/V-Shell","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vopaaz/V-Shell","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2FV-Shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2FV-Shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2FV-Shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2FV-Shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vopaaz","download_url":"https://codeload.github.com/Vopaaz/V-Shell/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vopaaz%2FV-Shell/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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","shell"],"created_at":"2024-10-13T00:04:12.118Z","updated_at":"2026-05-15T18:33:07.006Z","avatar_url":"https://github.com/Vopaaz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# V-Shell\n\nA Very basic Shell.\n\nIt's the course project (option 1) for Computer System Architechture, Professor Mao, Tsinghua SEM.\n\n\n\u003c!-- @import \"[TOC]\" {cmd=\"toc\" depthFrom=1 depthTo=6 orderedList=false} --\u003e\n\n\u003c!-- code_chunk_output --\u003e\n\n- [V-Shell](#V-Shell)\n  - [Instruction](#Instruction)\n    - [Prerequesites](#Prerequesites)\n    - [Build \u0026 Run](#Build--Run)\n    - [Supported Functions](#Supported-Functions)\n  - [Code Structure](#Code-Structure)\n  - [Demonstration Snippets](#Demonstration-Snippets)\n\n\u003c!-- /code_chunk_output --\u003e\n\n\n## Instruction\n\n### Prerequesites\n\n- System: Linux\n- Compiler: gcc\n\n### Build \u0026 Run\n\nBuilding:\n\n```bash\n$ make\n```\n\nRunning:\n\n```Bash\n$ ./vsh.exe\n```\n\n### Supported Functions\n\n- [x] Display prompt information (current working directory) and accept a command that the user keys in and execute the command\n  - The command can be an executable in the `PATH` followed by its arguments\n  - or `cd SOME_DIR`, which changes the working directory, and is the only supported built-in command\n- [x] When the execution is finished, the prompt will be displayed again and wait for next command\n- [x] The interpreter can be terminated with command `bye`\n- [x] Multiple commands in one line are allowed, they should be separated by `\u0026\u0026`\n- [x] Execute the command in background when the character `*` is append to the end of one command. **Note that this will prevent commands from using `*` as a wildcard parameter.**\n- [x] The shell will not terminate from being interrupted by `Ctrl-C`\n\n## Code Structure\n\nNote that the cognominal `.h` file is not listed here.\n\n```text\n📦V-Shell\n ┣ 📂src\n ┃ ┣ 📂util\n ┃ ┃ ┣ 📜config.h\n ┃ ┃ ┣ 📜debug.c\n ┃ ┃ ┣ 📜dir.c\n ┃ ┃ ┣ 📜execute.c\n ┃ ┃ ┣ 📜input.c\n ┃ ┃ ┣ 📜signalHandling.c\n ┃ ┗ 📜vshell.c\n ┣ 📜.gitignore\n ┣ 📜Makefile\n ┗ 📜README.md\n```\n\n- `src/util/config.h`: Define constants, macros, messages, syntax, etc. for the whole project.\n- `src/util/debug.c`: Provide print functions for debugging.\n- `src/util/dir.c`: Manage the current working directory.\n- `src/util/execute.c`: Kernel of v-shell, execute the input commands.\n- `src/util/input.c`: Receive user input and split them.\n- `src/util/signalHandling.c`: Handling `Ctrl+C` signals.\n- `src/vshell.c`: Entry point of the shell.\n\n\n## Demonstration Snippets\n\nIn the following demonstration, the lines start with `\\\\` are comments and explanations, while others are either output in the console or the user input.\n\n```text\n\\\\ Entering the v-shell\nroot@4683062396b4:/usr/vopaaz/v-shell# ./vsh.exe\n--------\nThis is a very basic shell by Vopaaz (Li YiFan) in June 2019.\nIt's the course project for Computer System Architechture, Professor Mao.\n--------\n\n\\\\ Basic commands supported\n/usr/vopaaz/v-shell \u003e ls\nMakefile  README.md  src  syncDocker.bat  vsh.exe\n\n\\\\ Redundant space before the first valid command\n/usr/vopaaz/v-shell \u003e      ls\nMakefile  README.md  src  syncDocker.bat  vsh.exe\n\n\\\\ Basic command and parameters\n/usr/vopaaz/v-shell \u003e ls -a\n.   .git        .vscode   README.md  syncDocker.bat\n..  .gitignore  Makefile  src        vsh.exe\n\n\\\\ Redundant space within the command\n/usr/vopaaz/v-shell \u003e ls           -a\n.   .git        .vscode   README.md  syncDocker.bat\n..  .gitignore  Makefile  src        vsh.exe\n\n\\\\ Built-in cd function that changes the working directory\n/usr/vopaaz/v-shell \u003e cd ..\n/usr/vopaaz \u003e cd v-shell\n\n\\\\ Use '*' to execute command in the background\n/usr/vopaaz/v-shell \u003e ls *\nCommand executing in the background, child process id [3012]\n/usr/vopaaz/v-shell \u003e Makefile  README.md  src  syncDocker.bat  vsh.exe\n\\\\ Note that the shell prompts first then comes the output of 'ls'.\n\n\\\\ Multiple commands in one line, separated by '\u0026\u0026'\n/usr/vopaaz/v-shell \u003e ls \u0026\u0026 ls \u0026\u0026 ls\nMakefile  README.md  src  syncDocker.bat  vsh.exe\nMakefile  README.md  src  syncDocker.bat  vsh.exe\nMakefile  README.md  src  syncDocker.bat  vsh.exe\n\n\\\\ Multiple commands executed in the background\n/usr/vopaaz/v-shell \u003e ls * \u0026\u0026 ls * \u0026\u0026 ls *\nCommand executing in the background, child process id [3016]\nCommand executing in the background, child process id [3017]\nCommand executing in the background, child process id [3018]\n/usr/vopaaz/v-shell \u003e Makefile  README.md  src  syncDocker.bat  vsh.exe\nMakefile  README.md  src  syncDocker.bat  vsh.exe\nMakefile  README.md  src  syncDocker.bat  vsh.exe\n\n\\\\ Available to handle commands that does not exist\n/usr/vopaaz/v-shell \u003e commands-that-not-exist\nExecution failed. Commands may be invalid.\n\n\\\\ If multiple commands are in one line and some of them are invalid,\n\\\\ only those valid ones before the invalid one will execute.\n/usr/vopaaz/v-shell \u003e ls \u0026\u0026 commands-that-not-exist\nMakefile  README.md  src  syncDocker.bat  vsh.exe\nExecution failed. Commands may be invalid.\n/usr/vopaaz/v-shell \u003e ls \u0026\u0026 commands-that-not-exist \u0026\u0026 ls\nMakefile  README.md  src  syncDocker.bat  vsh.exe\nExecution failed. Commands may be invalid.\n\n\\\\ Able to handle when no command follows the '\u0026\u0026' syntax\n/usr/vopaaz/v-shell \u003e ls \u0026\u0026\nMakefile  README.md  src  syncDocker.bat  vsh.exe\n\n\\\\ The shell is prevented from being interrupted by 'Ctrl+C'\n/usr/vopaaz/v-shell \u003e ^C\nCtrl+C detected, but the shell does not terminate according to the instruction.\nTo exit the shell, either use 'bye' or press 'Ctrl+Z'\n\n\\\\ The shell can be terminated using bye\n/usr/vopaaz/v-shell \u003e bye\nroot@4683062396b4:/usr/vopaaz#\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvopaaz%2Fv-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvopaaz%2Fv-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvopaaz%2Fv-shell/lists"}