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

Re: variables as grouping alternative?



On Wed, Jul 24, 2013 at 2:23 PM, Jérémie Roquet <arkanosis@xxxxxxxxx> wrote:
> 2013/7/24 Vin Shelton <acs@xxxxxxxxxxxxxxxxxxxx>:
>> Is there a way to use a variable as a grouping alternative?  E.g.:
>>
>> pkgbase=libpng
>> f=( $ZIPROOT/$pkgbase-*.(tar|tar.*|tgz)(Nom) ); echo $f
>>
>> yields:
>> /opt/zip/libpng-1.6.3.tar.gz /opt/zip/libpng-1.2.46.tar.gz
>> /opt/zip/libpng-1.2.40.tar.xz /opt/zip/libpng-1.2.31.tar.bz2
>>
>> x="tar|tar.*|tgz"
>> f=( $ZIPROOT/$pkgbase-*.($x)(Nom) ); echo $f
>>
>> yields nothing
>
> Try $~x instead of $x.
>

Yes, that works!  Thank you.

  - Vin



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