Development record
The guard's cd reader gives bash's reading no directory for three or more operands, but macOS /bin/bash 3.2.57 enters the first operand of `cd a b c` and exits 0 (verified 2026-10-11 with cd and pwd only), so a following `bash s.sh` runs the script in `a` while the guard leaves it unread. Same class as iss-2610111809142536; round 5 added the first operand for two operands only.
issueresolvedminoriss-2610111855583968
The guard's cd reader gives bash's reading no directory for three or more operands, but macOS /bin/bash 3.2.57 enters the first operand of cd a b c and exits 0 (verified 2026-10-11 with cd and pwd only), so a following bash s.sh runs the script in a while the guard leaves it unread. Same class as iss-2610111809142536; round 5 added the first operand for two operands only.
Frontmatter
| id | iss-2610111855583968 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2610111855583968-guard-cd-three-operands-bash32.md
open on GitHub ↗ · commit history ↗
mentions1
- iss-2610111809142536zsh reads `cd X Y` with two operands, and an option word it does not take (`cd -e X`, `cd -@ X`, `pushd -n X`), as the substitution form: it replaces the first word in the current directory's path with the second and enters the result, so the guard's script reader judges a script in one directory while zsh runs the one in another. Found by the Fable review of guard round 2 on 2026-10-11 (reproduced with zsh 5.9: `cd <p>/with-n/dir && pushd -n sub && pwd` prints <p>/withsub/dir); the cd forms predate that round, and round 2 made pushd -n read as staying put.