zsh-users
 help / color / mirror / code / Atom feed
* ZSH 3.0.8 and modifiers
@ 2002-01-25  3:53 The Doctor What
  2002-01-25  8:59 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: The Doctor What @ 2002-01-25  3:53 UTC (permalink / raw)
  To: zsh-users

I was hoping someone could help me with this...

I build up a big array of potential directories that might exist in
the array $path.  I then weed out all the ones that don't exist by
doing:

 path=( ${$path}(/N) )

This works great under the newer versions of ZSH (4.0 for example)
as long as NULL_GLOB and RC_EXPAND_PARAM are set (I suppose I don't
need the N with NULL_GLOB, but it's habit. :-)

But under 3.0.8 (on my Darwin/OS X iBook) it produces an array
with the string (/N) appended to each item.  Is there something I'm
missing?

This is the same with (/) instead of (/N) as well.


Ciao!

-- 
"Apparently if you play the Windows NT CD backwards you hear satanic messages."
"You think that's bad, if you play it forwards it installs Windows NT!"
	-- Orlando (on Slashdot)

The Doctor What: Need I say more?                http://docwhat.gerf.org/
docwhat@gerf.org                                                   KF6VNC


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ZSH 3.0.8 and modifiers
  2002-01-25  3:53 ZSH 3.0.8 and modifiers The Doctor What
@ 2002-01-25  8:59 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2002-01-25  8:59 UTC (permalink / raw)
  To: The Doctor What, zsh-users

On Jan 24,  9:53pm, The Doctor What wrote:
} Subject: ZSH 3.0.8 and modifiers
}
}  path=( ${$path}(/N) )

I presume you mean ${^path}, as ${$path} gives "bad substitution" in
4.0.x and expands to the PID (i.e., ${$}, i.e., $$) in 3.0.x.

} But under 3.0.8 (on my Darwin/OS X iBook) it produces an array
} with the string (/N) appended to each item.  Is there something I'm
} missing?

In 3.0.8, a trailing parenthesized string is not interpreted as glob
qualifiers unless there is at least one other globbing special char
in the rest of the string.  Brace expansions, including RC_EXPAND_PARAM,
are NOT considered to be globbing characters.

In 4.0.x, using brace expansion or RC_EXPAND_PARAM is sufficient to
cause the trailing the parens to be interpreted as qualifiers.  I have
forgotten when or why this change was made.

The usual workaround is to insert an empty alternation pattern into
the string, like so:

    path=( ${^path}(|)(/N) )


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-25  8:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-25  3:53 ZSH 3.0.8 and modifiers The Doctor What
2002-01-25  8:59 ` Bart Schaefer

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).