Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Arrays with each item on one line
- X-seq: zsh-users 16748
- From: "Benjamin R. Haskell" <zsh@xxxxxxxxxx>
- To: TJ Luoma <luomat@xxxxxxxxx>
- Subject: Re: Arrays with each item on one line
- Date: Tue, 31 Jan 2012 19:48:33 -0500 (EST)
- Cc: zsh-users@xxxxxxx
- In-reply-to: <CADjGqHs-i1p6BUjcHPCVppUj5Cc1XQHvkkPDMc89jw=7dR9C2w@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADjGqHs-i1p6BUjcHPCVppUj5Cc1XQHvkkPDMc89jw=7dR9C2w@mail.gmail.com>
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.
What do you get from running 'setopt'? I get:
autocd
noautomenu
autopushd
nocheckjobs
cshjunkiehistory
extendedglob
extendedhistory
noglobalrcs
globdots
histignoredups
histignorespace
histnostore
histsubstpattern
nohup
incappendhistory
interactive
login
magicequalsubst
monitor
nonotify
promptsubst
pushdsilent
shinstdin
zle
I don't think any of those should affect how arrays are interpreted.
So, you can probably ignore any of the ones in that list that appear in
yours, too.
--
Best,
Ben
Messages sorted by:
Reverse Date,
Date,
Thread,
Author