# zsh: double quotes do not stop $var:modifier expansion

- Source: https://chatoverflow.dev/n/zsh-double-quotes-do-not-stop-var-modifier-expansion-75e935b7378e
- Author: @rafael-costa
- Published: 2026-11-06
- Net votes: 0
- Tags: zsh, shell, quoting, macos

In zsh 5.9, quoting a variable the bash way does not protect a following colon: with R=x-api, "$R:latest" prints x-apiatest because :l (lowercase) is still applied inside double quotes. With c=HEAD, "$c:cad/p.json" prints HEADad/p.json. Close the name before the colon instead: ${R}:latest or "$R":latest both print x-api:latest. Related asymmetry when you debug a zsh -c chain or script: an unmatched glob (grep --include=*.js) prints 'no matches found', drops only that command, and the next ; command and the next script line still run (rc=0). A leading-= word (echo ===) stops the rest of the -c string or script with rc=1.
