Hello, World!
echo "Hello, World!"Tap Run to execute
main.sh · output appears here
Press Run to execute
Output streams here as your program runs.
Bash (the Bourne Again SHell) is a Unix shell and command language written by Brian Fox for the GNU Project as a free replacement for the Bourne shell, first released in 1989. It is both an interactive command interpreter and a scripting language, supporting variables, control structures, functions, pipelines, and command substitution.
Bash is the default login shell on most Linux distributions and is widely used for system administration, automation, build scripts, and gluing together command-line tools. Its ability to chain commands with pipes and redirections makes it an essential tool for DevOps, deployment scripts, and everyday workflow automation on Unix-like systems.
main.sh is the entry point for each run.
Use the Input panel to pipe standard input to your program when it needs data.
Run sends your code to a fresh hosted runtime and streams the result into the output panel.
Your draft stays in this browser, and Share creates a separate snapshot link.
echo "Hello, World!"read -p "Enter your name: " name
echo "Hello, $name!"fruits=("apple" "banana" "cherry")
for i in "${!fruits[@]}"; do
echo "$((i + 1)): ${fruits[$i]}"
donefactorial() {
if [ "$1" -le 1 ]; then
echo 1
else
echo $(( $1 * $(factorial $(( $1 - 1 ))) ))
fi
}
factorial 5declare -A ages
ages[alice]=30
ages[bob]=25
for name in "${!ages[@]}"; do
echo "$name is ${ages[$name]}"
donefile="data.txt"
if [ -f "$file" ]; then
echo "$file exists"
else
echo "$file not found"
fi
name="bash"
if [[ "$name" == b* ]]; then
echo "starts with b"
fin=5
result=$((n * n))
echo "square: $result"
case "$n" in
1) echo "one" ;;
5) echo "five" ;;
*) echo "other" ;;
esacwhile IFS= read -r line; do
echo "Line: $line"
donepath="/usr/local/bin/script.sh"
echo "${path##*/}" # basename: script.sh
echo "${path%/*}" # dirname: /usr/local/bin
echo "${path/.sh/.bak}" # replace: ...script.bak
upper="HELLO"
echo "${upper,,}" # lowercase: hellocount=$(printf "a\nb\nc\n" | wc -l)
echo "lines: $count"
for word in $(echo "one two three"); do
echo "word: $word"
doneThe editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.
Type or paste your code into the editor, then click Run (or press Ctrl/Cmd + Enter) to execute it.
Output streams into the console panel, including runtime errors, exit status, and execution time.
Nothing to install and no account to create — code runs in an isolated hosted runtime.
Language-aware autocomplete and IntelliSense suggestions where the editor has a matching language service
Syntax highlighting, with native compiler and runtime errors shown in the console
Bracket matching, auto-indentation, code folding, and a minimap
Multi-cursor editing plus find & replace (Ctrl/Cmd + F)
Full undo/redo history and copy to clipboard
Built on Monaco — the same editor that powers VS Code
Run on demand, or turn on Auto-run to execute on every change
Stop long-running or infinite programs at any time
A real console shows standard output, errors, exit status, and execution time
Pass standard input (stdin) to your program from the Input panel — one value per line
Switch between light and dark themes
Adjust font size and other editor settings
Toggle side-by-side or top/bottom layouts
Enter distraction-free fullscreen mode
Generate a shareable link to your exact code in one click — no login needed
Your work autosaves to your browser, so you can pick up where you left off
Copy the active file to your clipboard
Run code: Ctrl/Cmd + Enter
Find & replace: Ctrl/Cmd + F
Open the full shortcut list from the keyboard icon in the toolbar
Bash is one of 46 single-file compiler scratchpads. Each run submits only main.sh; local sibling-file imports are not enabled.
Linked-project languages (23): Node.js, TypeScript, Deno, Python, C, Go, Dart, Swift, Rust, Ruby, PHP, Java, Kotlin, C++, C#, Nim, Crystal, Haxe, Zig, Scala, D, Bun, Objective-C.
Single-file scratchpads (46): Matplotlib, NumPy, pandas, Haskell, Clojure, Perl, Lua, Tcl, jq, Raku, Elixir, Bash, Zsh, Nushell, R, Assembly (NASM), Julia, Octave, Groovy, PowerShell, Visual Basic .NET, Odin, Pascal, Lisp, Erlang, CoffeeScript, COBOL, BASIC, V, Racket, OCaml, Prolog, AWK, Emacs Lisp, Emojicode, Forth, F#, Fortran, Assembly (NASM64), Solidity, Mojo, Ada, WASM (WAT), Gleam, Shell Script (sh), Scheme.
Download file exports the active Bash source file.