Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Arrays with each item on one line



On Tue, 31 Jan 2012, TJ Luoma wrote:

On Tue, Jan 31, 2012 at 7:48 PM, Benjamin R. Haskell <zsh@xxxxxxxxxx> wrote:
What do you get from running 'setopt'? I get:

autocd
extendedglob
nofunctionargzero
interactive
listpacked
login
promptsubst
pushdignoredups
shinstdin

Even with that set of options, I don't get the behavior you described. Maybe I'm misunderstanding your explanation? It seems more likely that you're not posting the actual code you're using. Running the code you posted:

	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

on the OSX machine I have access to, I get (as expected, since the files don't exist):

$
ls: /Users/bhaskell/Library/Application Support/Keyboard Maestro: No such file or directory
ls: /Users/bhaskell/Library/Preferences/com.stairways.keyboardmaestro.editor.plist: No such file or directory
ls: /Users/bhaskell/Library/Preferences/com.stairways.keyboardmaestro.engine.plist: No such file or directory
ls: /Users/bhaskell/Library/Preferences/com.stairways.keyboardmaestro.plist: No such file or directory
$

So, the FILES array is only looped over once.

--
Best,
Ben



Messages sorted by: Reverse Date, Date, Thread, Author