Skip to content

A high-performance Bash-compatible shell written in C

License

Notifications You must be signed in to change notification settings

vaxp/VenomShell

Repository files navigation

VenomShell

🐍 A high-performance Bash-compatible shell written in C

License C Standard Bash Compat


Overview

VenomShell is a modern, from-scratch implementation of a POSIX-compliant shell with Bash 5.x syntax compatibility. Built for performance, security, and maintainability.

Features

  • Bash-compatible syntax - Drop-in replacement for most Bash scripts
  • Pipelines - cmd1 | cmd2 | cmd3
  • Redirections - >, >>, <, 2>, &>
  • Control structures - if, for, while, case
  • Functions - function name() { ... }
  • Variables - $var, ${var}, environment sync
  • 25+ builtins - cd, echo, export, test, etc.
  • Background jobs - cmd &

Building

# Configure
cmake -B build -DCMAKE_BUILD_TYPE=Release

# Build
cmake --build build

# Run
./build/venom

Debug Build

cmake -B build -DCMAKE_BUILD_TYPE=Debug
cmake --build build

Usage

# Interactive mode
./venom

# Execute command
./venom -c 'echo "Hello World"'

# Run script
./venom script.sh

# Get help
./venom --help

Examples

# Variables
export NAME="VenomShell"
echo "Welcome to $NAME"

# Pipelines
ls -la | grep ".c" | wc -l

# Control flow
for file in *.c; do
    echo "Found: $file"
done

# Conditionals
if [ -f /etc/passwd ]; then
    echo "File exists"
fi

Architecture

Input → Lexer → Parser → AST → Executor
         ↓         ↓        ↓
      Tokens    Grammar   Tree

Project Structure

VenomShell/
├── include/          # Header files
│   ├── venom.h       # Main API
│   ├── lexer.h       # Tokenizer
│   ├── parser.h      # Parser
│   ├── ast.h         # Abstract Syntax Tree
│   ├── exec.h        # Executor
│   └── builtin.h     # Built-in commands
├── src/              # Source files
│   ├── main.c        # Entry point
│   ├── lexer.c       # Tokenization
│   ├── parser.c      # Parsing
│   ├── ast.c         # AST operations
│   ├── exec.c        # Execution
│   └── builtin.c     # Builtins
└── tests/            # Test suite

About

A high-performance Bash-compatible shell written in C

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published