Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

11
  • 4
    Brace expansion isn't performed within single or double quotes Commented Jun 6, 2019 at 6:47
  • 3
    @SergiyKolodyazhnyy The point of the question is that the ? is also quoted, and gets expanded after $(...) substitutes it, but the brace expansion doesn't. Commented Jun 6, 2019 at 6:48
  • 1
    @muru No, that's not the same issue. Here the order of expansions doesn't matter, what matters is which expansion takes place in which context. I wouldn't be surprised if this question was a duplicate, but I couldn't find it. Commented Jun 6, 2019 at 7:00
  • 1
    @mosvy Ksh and bash do expansions in the same order, but ksh does brace expansion in a case where bash doesn't do it at all. Zsh-with-globsubst does the same expansions as bash, but in a different order. Commented Jun 6, 2019 at 20:59
  • 1
    @Gilles no they don't. As documented and easily demonstrated, ksh (and zsh) will perform the brace expansion just before globbing. zsh-with-globsubst won't perform any brace expansion at all on the results of $-expansions: zsh -o globsubst -c 'a=/e*; b={/b*,/v*}; echo $a; echo $b'. Commented Jun 6, 2019 at 22:14