* variables as grouping alternative?
@ 2013-07-24 18:14 Vin Shelton
2013-07-24 18:23 ` Jérémie Roquet
0 siblings, 1 reply; 3+ messages in thread
From: Vin Shelton @ 2013-07-24 18:14 UTC (permalink / raw)
To: zsh-users
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
Thanks in advance,
Vin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: variables as grouping alternative?
2013-07-24 18:14 variables as grouping alternative? Vin Shelton
@ 2013-07-24 18:23 ` Jérémie Roquet
2013-07-25 3:35 ` Vin Shelton
0 siblings, 1 reply; 3+ messages in thread
From: Jérémie Roquet @ 2013-07-24 18:23 UTC (permalink / raw)
To: Vin Shelton; +Cc: zsh-users
Hi,
2013/7/24 Vin Shelton <acs@alumni.princeton.edu>:
> 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.
Best regards,
--
Jérémie
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: variables as grouping alternative?
2013-07-24 18:23 ` Jérémie Roquet
@ 2013-07-25 3:35 ` Vin Shelton
0 siblings, 0 replies; 3+ messages in thread
From: Vin Shelton @ 2013-07-25 3:35 UTC (permalink / raw)
To: Jérémie Roquet; +Cc: zsh-users
On Wed, Jul 24, 2013 at 2:23 PM, Jérémie Roquet <arkanosis@gmail.com> wrote:
> 2013/7/24 Vin Shelton <acs@alumni.princeton.edu>:
>> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-25 3:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-24 18:14 variables as grouping alternative? Vin Shelton
2013-07-24 18:23 ` Jérémie Roquet
2013-07-25 3:35 ` Vin Shelton
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).