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

Re: Help von glob_subst



> 
> Please help,
> 
> I have been using the following construct quite often (recently it does not work
> any more, since there has been a `bug fix` in ZSH)
> 
> e.g.
> file  Test
> 
> #!/bin/zsh
> Pattern=$1(.)
> eval List=$Pattern
> 
> 
> invoking it like
> 
> Test `**/*`
> 
> I got the expansion in $List.
> 
> How is it done now?

I mentioned this change in the announcement of beta17 (which was admittedly
quite long and boring :-)).  The right-hand side of assignments are no
longer globbed by default.  You should use

foo=( glob-pattern )

if you want an array of matches.  This has always been the preferred way to
create arrays, now it is the only way (besides set -A).  See also in the
zshoptions manual page the description of the GLOB_ASSIGN option.

But for your problem there is an even simpler solution:

#!/bin/zsh
List=( $~1(.) )

Zoltan




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