{"id":21159095,"url":"https://github.com/marob05/mbsh","last_synced_at":"2025-10-14T08:32:30.040Z","repository":{"id":262118443,"uuid":"885854244","full_name":"MaroB05/MBsh","owner":"MaroB05","description":"My implementation of a simple shell for linux","archived":false,"fork":false,"pushed_at":"2025-04-13T19:51:54.000Z","size":48,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-14T08:32:06.119Z","etag":null,"topics":["c","posix","posix-shell","shell","terminal"],"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/MaroB05.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-09T15:14:11.000Z","updated_at":"2025-04-13T19:51:57.000Z","dependencies_parsed_at":"2024-12-11T00:23:22.056Z","dependency_job_id":"fcadb2b1-76f0-468a-8826-82dbd0c04fa2","html_url":"https://github.com/MaroB05/MBsh","commit_stats":null,"previous_names":["marob05/mbsh"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MaroB05/MBsh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaroB05%2FMBsh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaroB05%2FMBsh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaroB05%2FMBsh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaroB05%2FMBsh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaroB05","download_url":"https://codeload.github.com/MaroB05/MBsh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaroB05%2FMBsh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018310,"owners_count":26086342,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","posix","posix-shell","shell","terminal"],"created_at":"2024-11-20T12:59:09.092Z","updated_at":"2025-10-14T08:32:30.024Z","avatar_url":"https://github.com/MaroB05.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MBsh (MaroB Shell)\n\nMBsh is a simple shell implemented in C, designed to execute external programs and parse command arguments. This project focuses on understanding the basics of shell functionality, with a minimalist approach to error handling.\n\n## Table of Contents\n1. [Project Overview](#project-overview)\n2. [Features](#features)\n3. [Installation](#installation)\n4. [Usage](#usage)\n5. [How It Works](#how-it-works)\n6. [Known Issues and Limitations](#known-issues-and-limitations)\n7. [Future Improvements](#future-improvements)\n8. [Contributing](#contributing)\n\n---\n\n## Project Overview\n\nMBsh provides a basic shell environment that executes external commands, similar to `/bin/sh`. It does not currently support internal commands like `cd` or `exit`, keeping the focus on external program execution and argument parsing.\n\n## Features\n\n- **Program Execution:** Runs external programs (e.g., `/bin/ls`, `/bin/echo`) with specified arguments.\n- **Argument Parsing:** Parses and passes command-line arguments to the programs.\n- **Minimal Error Handling:** Basic error handling to manage invalid commands or missing arguments.\n\n## Installation\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/your-username/MBsh.git\n    ```\n\n2. Navigate to the project directory:\n    ```bash\n    cd MBsh\n    ```\n\n3. Compile the code:\n    ```bash\n    make compile\n    ```\n\n## Usage\n\nTo start MBsh, run:\n```bash\nmake run\n```\nor\n```bash\n./build/MBsh.out\n```\n## How It Works\n\n### Step 1: Input and Parsing\n- MBsh reads user input and splits it into the program name and arguments.\n- Basic error checks are applied, such as handling empty input.\n\n### Step 2: Specify command type:\n- Based on the given command, MBsh classifies if the command is either internal or external.\n\n### Step 3: Forking and Execution\n- MBsh uses `fork()` to create a new process for executing the program in case of an external command.\n- In the child process, `execvp()` is called to run the specified program with arguments.\n\n### Step 4: Error Handling and Continuation\n- Minimal error handling is in place for unrecognized commands or argument errors.\n- MBsh continues prompting for new commands unless terminated.\n## Known Issues and Limitations\n\n- **Limited Internal Commands:** only implemented `cd` and `exit` as internal shell commands.\n- **Limited Error Feedback:** Error handling is minimal, providing basic feedback on invalid commands.\n- **No Redirection or Piping:** Features like input/output redirection and piping are not implemented.\n\n## Future Improvements\n\n- **Add Internal Commands:** Implement internal commands, such as `cd` and `exit`.\n- **Enhanced Error Handling:** Provide more informative error messages and handle additional edge cases.\n- **Support for Redirection and Piping:** Enable support for `\u003e`, `\u003c`, and `|` operators.\n- **Job Control:** Allow commands to be run in the background with `\u0026`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarob05%2Fmbsh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarob05%2Fmbsh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarob05%2Fmbsh/lists"}