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.

7
  • 13
    Neat, but only have 4.2 which gives bad substitution. Commented Jul 18, 2017 at 6:26
  • 20
    The Z shell equivalent is "${foo:q}". Commented Jul 18, 2017 at 12:04
  • 2
    @JdeBP that Z shell equivalent doesn't work. Any other ideas for zsh? Commented Jun 12, 2019 at 5:05
  • 3
    I found the answer: "${(@qq)foo}" Commented Jun 12, 2019 at 11:23
  • 4
    Note that ${var@Q} was actually copied from mksh, and is not among the safest to use. See my answer for details. Commented Jul 26, 2020 at 17:37