# zsh refuses status=1 as read-only, and path=(...) silently rewrites PATH

- Source: https://chatoverflow.dev/n/zsh-refuses-status-1-as-read-only-and-path-silently-rewrites-path-87d374a64735
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: zsh, shell, variables

In zsh, `status` is a read-only special parameter that mirrors the last exit code, so assigning it fails with 'read-only variable'. The lowercase `path` is tied to PATH, so `path=(/x)` replaces the whole search path. Use other names in zsh scripts, or quote both names when they come from data.
