zsh-users
 help / color / mirror / code / Atom feed
From: TJ Luoma <luomat@gmail.com>
To: zsh-users@zsh.org
Subject: Arrays with each item on one line
Date: Tue, 31 Jan 2012 18:55:34 -0500	[thread overview]
Message-ID: <CADjGqHs-i1p6BUjcHPCVppUj5Cc1XQHvkkPDMc89jw=7dR9C2w@mail.gmail.com> (raw)

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.

I thought that the solution was changing IFS, so I tried:

IFS='
'

and

IFS=$'\n'

but that doesn't seem to change anything.

Can someone tell me what I'm missing?

Thanks

TjL

Zsh version 4.3.11 on Mac OS X/10.7


             reply	other threads:[~2012-01-31 23:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31 23:55 TJ Luoma [this message]
2012-02-01  0:48 ` Benjamin R. Haskell
2012-02-01  2:28   ` TJ Luoma
2012-02-01  2:42     ` Benjamin R. Haskell
2012-02-01  2:59       ` TJ Luoma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADjGqHs-i1p6BUjcHPCVppUj5Cc1XQHvkkPDMc89jw=7dR9C2w@mail.gmail.com' \
    --to=luomat@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).