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

Re: globbing for links in pathnames



On Thu, Feb 04, 1999 at 05:23:32PM -0700, Steve Talley wrote:
> > % ls $( ls -d test/*(@) )/man(/)
> 
> Thanks!  This is _almost_ what I want, but the above glob will
> only add the last part ("man") to the last element of the list
> from the earlier part.
> 
> So a general question is:  Is there a way to make
> 
> (a b c d)/man
> 
> expand to
> 
> a/man b/man c/man d/man

	the RC_EXPAND_PARAM option, which can be turned on/off
for a given expansion via the ${^...} construct:

(astaroth)~1: FOO=(a b c d)
(astaroth)~2: echo ${FOO}/man
a b c d/man
(astaroth)~3: echo ${^FOO}/man
a/man b/man c/man d/man

	-- sweth.

-- 
Sweth Chandramouli
IS Coordinator, The George Washington University
<sweth@xxxxxxx> / (202) 994 - 8521 (V) / (202) 994 - 0458 (F)
<a href="http://astaroth.nit.gwu.edu/~sweth/disc.html";>*</a>



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