shell - ZSH for loop array variable issue -


im working in zsh, im sure bash instructions also. need have loop goes thru values stored in array lw , launches shell script, based on name stored in array.

so far, i've come with:

$lw=('plugin1' 'plugin2' 'plugin3')  in $lw;   . ~/library/rogall/plugins/$lw[$i]/lw.prg end; done 

it gives me error when run saying can't find ~/library/rogall/plugins//lw.prg, appears ignoring variable togethor.

any ideas i've messed up?

it's simpler that:

lw=('plugin1' 'plugin2' 'plugin3')  in $lw;   . ~/library/rogall/plugins/$i/lw.prg end done 

in summary:

  • assign "foo", not "$foo" (the shell try expand $foo , assign whatever expands to; typically not useful)
  • use loop variable directly; contains array value rather index

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -