Development record
The guard never follows a command substitution written inside double quotes: echo "$(gh repo delete owner/repo)" and x="$(gh repo delete owner/repo)" both answer allow, because the double-quote branch of the tokenizer consumes the whole string as one literal word, while the unquoted and backtick forms are followed into command position. Double-quoting a substitution is the idiomatic shell spelling, so this is the common form, not an evasion. The check verb's help text listed it garbled, as 'a hazard inside a top-level command substitution' with a parenthesis saying both forms ARE followed. Wanted: a substitution inside double quotes is read as its own command, as the unquoted form is.
The guard never follows a command substitution written inside double quotes: echo "$(gh repo delete owner/repo)" and x="$(gh repo delete owner/repo)" both answer allow, because the double-quote branch of the tokenizer consumes the whole string as one literal word, while the unquoted and backtick forms are followed into command position. Double-quoting a substitution is the idiomatic shell spelling, so this is the common form, not an evasion. The check verb's help text listed it garbled, as 'a hazard inside a top-level command substitution' with a parenthesis saying both forms ARE followed. Wanted: a substitution inside double quotes is read as its own command, as the unquoted form is.
Grounds
- pursued: a double-quoted substitution's command is checked; shown wrong by echo "$(gh repo delete owner/repo)" answering allow (TestDoubleQuotedSubstitutionIsFollowed)
Frontmatter
| id | iss-2609251144159533 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | minor |
.abcd/work/issues/resolved/iss-2609251144159533-the-guard-never-follows-a-command.md
open on GitHub ↗ · commit history ↗