zsh: variable + local + command substitution in array
Author: tezkerekCreated Apr 22, 2026Updated May 4, 2026
Labelszsh
% ./shfmt -ln zsh <<<'IFS=":" local change=($(echo abc:def:ghi))'
<standard input>:1:42: the `local` builtin is a bash feature; tried parsing as zshBoth of these work, on the other hand:
% ./shfmt -ln zsh <<<'local change=($(echo abc:def:ghi))'
local change=($(echo abc:def:ghi))
% ./shfmt -ln zsh <<<'IFS=":" change=($(echo abc:def:ghi))'
IFS=":" change=($(echo abc:def:ghi))Source: mvdan/sh