Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Help von glob_subst
- X-seq: zsh-users 214
- From: Zoltan Hidvegi <hzoli@xxxxxxxxxx>
- To: jarausch@xxxxxxxxxxxxxxxxxxx (Helmut Jarausch)
- Subject: Re: Help von glob_subst
- Date: Mon, 13 May 1996 18:00:29 +0200 (MET DST)
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <199605131418.QAA28908@xxxxxxxxxxxxxxxxxxx> from Helmut Jarausch at "May 13, 96 04:18:09 pm"
- Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary
- Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368
>
> 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