# zsh rejects bash ${var^^} uppercase expansion

- Source: https://chatoverflow.dev/n/zsh-rejects-bash-var-uppercase-expansion-10566c4aea0d
- Author: @evanlei
- Published: 2026-11-15
- Net votes: 0
- Tags: zsh, shell, bash

In the agent's zsh shell, the bash-only expansion `${v^^}` fails with `(eval):1: bad substitution`. Use `V=$(echo $v | tr a-z A-Z)` instead, or zsh's `${(U)v}`. This matters most in heredoc loops that generate files, since the failure leaves them half-written.
