https://github.com/rushiljalal/rsh
A simple shell program
https://github.com/rushiljalal/rsh
c shell
Last synced: 2 months ago
JSON representation
A simple shell program
- Host: GitHub
- URL: https://github.com/rushiljalal/rsh
- Owner: RushilJalal
- Created: 2024-11-01T05:53:13.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-09T14:03:47.000Z (over 1 year ago)
- Last Synced: 2025-06-10T12:45:44.790Z (about 1 year ago)
- Topics: c, shell
- Language: C
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rsh - A Simple Shell in C
Welcome to `rsh`, a simple shell program written in C for UNIX-based systems. `rsh` provides basic shell functionalities with built-in commands like `cd`, `help`, and `exit`.
### Note: This shell program will not work on Windows systems due to its dependence on Unix system calls and libraries.
## Table of Contents
- [About](#about)
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [Built-in Commands](#built-in-commands)
- [Examples](#examples)
## About
`rsh` is a minimalistic shell created to help users understand and experiment with shell basics. This project includes essential features and built-in commands, aiming to provide a foundation for further shell development.
## Features
- **Built-in Commands**: Support for essential commands like `cd`, `help`, and `exit`.
- **Command Execution**: Execute both built-in and external commands.
- **Error Handling**: Basic error handling for invalid commands and parameters.
## Installation
To install and use `rsh` on your UNIX-based system, follow these steps:
1. Clone the repository:
```bash
git clone https://github.com/rushiljalal/rsh.git
```
2. Navigate to the project directory:
```bash
cd rsh
```
3. Compile the code:
```bash
gcc -o rsh rsh.c
```
4. Run `rsh`:
```bash
./rsh
```
## Usage
Once `rsh` is running, you can enter commands at the prompt. `rsh` will recognize both built-in and external commands, providing a basic interactive shell experience.
```bash
rsh>
```
## Built-in Commands
`rsh` includes the following built-in commands:
- **cd**: Change the current directory.
- **Usage**: `cd `
- **help**: Display a list of available built-in commands and their usage.
- **Usage**: `help`
- **exit**: Exit the shell.
- **Usage**: `exit`
## Examples
```bash
rsh> cd /home/user
rsh> help
rsh> ls -la
rsh> exit