Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harsha-yuvaraj/rapid-unix-shell
A custom Unix-based shell developed in C, designed to execute standard Unix commands like ls, grep, mkdir, and awk. It supports parallel command execution, output redirection, and robust error handling.
https://github.com/harsha-yuvaraj/rapid-unix-shell
c operating-systems shell unix
Last synced: 16 days ago
JSON representation
A custom Unix-based shell developed in C, designed to execute standard Unix commands like ls, grep, mkdir, and awk. It supports parallel command execution, output redirection, and robust error handling.
- Host: GitHub
- URL: https://github.com/harsha-yuvaraj/rapid-unix-shell
- Owner: harsha-yuvaraj
- Created: 2024-10-02T02:32:25.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-03T02:14:37.000Z (about 1 month ago)
- Last Synced: 2025-01-03T03:25:00.404Z (about 1 month ago)
- Topics: c, operating-systems, shell, unix
- Language: C
- Homepage:
- Size: 41 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rapid Unix Shell
## Project Overview
A custom Unix-based shell developed in C, designed to execute standard Unix commands like `ls`, `grep`, `mkdir`, and `awk`. It supports parallel command execution, output redirection, and robust error handling. The shell also provides built-in commands like `cd`, `path`, and `exit` for convenient navigation and process control.## Features
- **Command Execution**: Supports Unix commands such as `cat`, `grep`, `touch`, `mkdir`, and more.
- **Parallel Execution**: Use `&` to run multiple commands in parallel.
- **Input/Output Redirection**: Redirect output to a file using the `>` operator.
- **Built-in Commands**:
- `cd`: Change directories.
- `path`: Manage executable search paths.
- `exit`: Exit the shell.
- **Robust Error Handling**: Includes mechanisms for handling incorrect commands and system call failures.
- **Flexible Input Parsing**: Programmed to handle multiple spaces or tabs between commands and arguments, empty commands between parallel operators (&), and mixed use of spaces and tabs for formatting.## Getting Started
### Prerequisites
- A Unix-based environment (Linux or macOS).
- GCC compiler (version 11.4.0 or later).### Compilation
To compile the project, use the provided `Makefile`. Simply run:
```bash
make
```### Running the Shell
Once compiled, start the shell by running:
```bash
./rush
```
The shell will prompt with rush>, ready to accept commands. You can execute standard Unix commands, run multiple commands in parallel, or redirect output to files.### Examples
Here are some examples of how to use the shell:**Single Command**: Run a simple command like ls to list directory contents:
```
rush> ls -l
```
**Output Redirection**: Redirect the output of a command to a file using the `>` operator:
```
rush> ls -l > output.txt
```
**Parallel Commands**: Run multiple commands in parallel by using the `&` operator:
```
rush> mkdir newdir & grep "text" file.txt & ls -l > output.txt
```## Error Handling
The shell includes robust error handling for situations such as invalid commands, incorrect use of redirection, failed command execution, and more. For example:**Invalid Directory in cd**: If an invalid directory is provided to the cd command, an error will be displayed.
```
rush> cd nonexistentdir
An error has occurred
```