Code tool

Bash Parameter Expansion

Enter literal variable values and evaluate one parameter expression without running commands.

In-browser processingNo account requiredPrivacy details ↗

Case conversion changes ASCII letters only. A negative substring offset needs a space: ${name: -2}. No execution occurs.

${name} · ${#name} · ${name:-guest} · ${name:=guest} · ${name:+yes} · ${name:?missing} · ${name:1:3} · ${file##*/} · ${file%.txt} · ${name//l/L} · ${name^^}

A QUICK WALKTHROUGH

How to use this tool

  1. Enter one NAME=value per line; omit a name to leave it unset.
  2. Enter one expression such as ${file##*/}.
  3. Expand and review the result and current variable values.

Supported expressions

Supports ${name}, ${#name}, default/alternate/assignment/error operators, integer substrings, prefix/suffix removal, replacement, and ASCII case conversion. Patterns support only * and ?. Replacement patterns must match at least one character.

Scope and limits

This is a static parameter-expression simulator, not a shell. No command, arithmetic, process or nested substitution; arrays, quoting, escape syntax, bracket patterns, tilde expansion, word splitting and filesystem expansion are unsupported. Variable values are literal text, including quotes and dollar signs. Replacement values are literal; & is rejected.

GOOD TO KNOW

Common questions

Are commands executed?

No. Only entered variables are used. Nothing reads system variables or files, and data is not uploaded.

Does assignment persist?

The = and := operators update the displayed variables for that calculation only. Copy them into the input for another calculation.