#1327·sh

zsh: variable + local + command substitution in array

Author: tezkerekCreated Apr 22, 2026Updated May 4, 2026
Labelszsh
bash
% ./shfmt -ln zsh <<<'IFS=":" local change=($(echo abc:def:ghi))'
<standard input>:1:42: the `local` builtin is a bash feature; tried parsing as zsh

Both of these work, on the other hand:

bash
% ./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))