Bash
Bash 5.2

Run Bash 5.2 Online

Execute Bash scripts instantly in a secure, isolated sandbox. No server access needed — test your shell scripts safely online.

script.sh
Output
Click "Run Code" to execute...

About Bash

Bash is the default shell on most Linux and macOS systems, essential for shell scripting, automation, DevOps pipelines, and system administration. It provides powerful text processing, file manipulation, and process management capabilities.

Our sandbox runs Bash 5.2 with common GNU utilities available.

Sandbox Features

  • Secure execution with Docker + gVisor isolation
  • Bash 5.2 with GNU coreutils
  • Up to 300s execution time (Pro tier)
  • Stdin support for interactive scripts
  • REST API for programmatic access
  • No setup or installation required

Use Bash with stateful sessions

Open a session once, then call execute repeatedly — variables, files, and installed packages persist between runs. Perfect for code interpreters and REPL-style agents.

# 1. Create a session
curl -X POST https://api.sandboxapi.dev/v1/sessions \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"language":"bash","idle_ttl":300}'
# → {"id":"sess_abc","language":"bash",...}

# 2. Execute — first call
curl -X POST https://api.sandboxapi.dev/v1/sessions/sess_abc/execute \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"code":"export X=42"}'

# 3. Execute again — state carries over
curl -X POST https://api.sandboxapi.dev/v1/sessions/sess_abc/execute \
  -H "X-RapidAPI-Key: $KEY" \
  -d '{"code":"echo $((X * 2))"}'
Read the sessions docs →

Run Code in Other Languages

Need More? Get API Access

Integrate secure code execution into your own apps with our REST API. Free tier includes 500 executions per month.

Get API Key on RapidAPI