1 Feb 01:48
Re: Arrays with each item on one line
Benjamin R. Haskell <zsh <at> benizi.com>
2012-02-01 00:48:33 GMT
2012-02-01 00:48:33 GMT
On Tue, 31 Jan 2012, TJ Luoma wrote:
> I don't understand arrays very well and am trying to learn.
>
> I keep trying to do things like this:
>
> FILES=("$HOME/Library/Application Support/Keyboard Maestro"
> "$HOME/Library/Preferences/com.stairways.keyboardmaestro.editor.plist"
> "$HOME/Library/Preferences/com.stairways.keyboardmaestro.engine.plist"
> "$HOME/Library/Preferences/com.stairways.keyboardmaestro.plist")
>
> for F in $FILES
> do
>
> command ls -ld "$F"
>
> done
>
> but instead of $F being each line for 4 iterations of the loop, I get
> all 4 lines x 4 times.
>
> [...]
>
> Can someone tell me what I'm missing?
>
> [...]
>
> Zsh version 4.3.11 on Mac OS X/10.7
Your example works fine for me using Zsh version 4.3.11 under OSX 10.7.
(Continue reading)
RSS Feed