Skip to content

zsh: extended_glob [x] must be followed by = #1322

Closed

Description

@turquoise-turtle
#!/bin/zsh --no-rcs
setopt extended_glob null_glob
BASE_DIR="/Applications/PaperCut Print Deploy Client"
YEAR="2025"
matches=( "${BASE_DIR}/v${YEAR}-"[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9] )
print "Matched folders: ${#matches}"

When running shfmt on this script I get the following error:

`[x]` must be followed by `=`

An example of a folder that would be returned in the matches array: /.../v2025-10-06-1019

Btw, I'm very grateful for the zsh syntax being added to shfmt. It was a very welcome surprise when checking up on the project again last week after finding out about shfmt last year.

Activity

  1. added a commit that references this issue on May 3, 2026
    0bb52b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址