Skip to content

zsh: support word-split parameter expansion #1238

@mdekstrand

Description

@mdekstrand

With shfmt from current git:

$ echo 'arr=(${=space_separated_param})' |shfmt -ln zsh
<standard input>:1:8: invalid parameter name

From zshexpn(1), the = syntax (supported as both $=name and ${=name}) applies shell splitting to the value of name, expanding to an array of values. As near as I can tell, it is the canonical zsh way to go from space-separated, quoted values to arrays.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions