It’s actually much simpler than that:
lw=('plugin1' 'plugin2' 'plugin3')
for i in $lw; do
. ~/Library/Rogall/plugins/$i/lw.prg end
done
In summary:
- Assign to
foo, not$foo(the shell would try to expand$fooand assign to whatever it expands to; typically not useful) - Use the loop variable directly; it contains the array value rather than the index