Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Glob problem
- X-seq: zsh-users 18046
- From: Jérémie Roquet <arkanosis@xxxxxxxxx>
- To: Brent Briggs <brent.briggs@xxxxxxxxx>
- Subject: Re: Glob problem
- Date: Tue, 22 Oct 2013 18:58:04 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=JeD0AkJRdDEUoK4+9IDaB2HsHadSR9gZIuqy0uyEoQw=; b=vCRpyid0JHurH+veBh+IuJyi0dw04R+8j1W3kBoGa56cwvsKuX5AbNSvqyIu0HbcHV xtYQLvoW1gwsjjqRJYB8LzDoKtAwMp9a7cQN2gdq2XAfaE+mc4f8T59blfExlKAMD+UC NpiZ9zIbHl1eWYJjuVHv0+BEwB4+kxHxhTbstWwFuUBoDh1YJjGnLrRHYJv6v8fhfXxQ ahvkdw2jZqKankp8AkUyzioY7crdbOgBdUc+ytt73+eUShOF4cJyK31y+LSTV8s3/CpQ /ycWZ3V5cMH/FMVm+HhAg4aRzriQTjy/QGI566mmEY+w1ApKauShH+vLzAdO3DoqQlYo TLAQ==
- In-reply-to: <F814E825-D3A5-420E-B289-6D3B0FB47D75@gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <F814E825-D3A5-420E-B289-6D3B0FB47D75@gmail.com>
Hi,
2013/10/22 Brent Briggs <brent.briggs@xxxxxxxxx>:
> I am simply trying to list all matches for a specified pattern in an array of directory paths, the $path array for example. Here is my attempt. Where am I going wrong?
>
> pattern=git*
> for entry in $path
> do
> # Print all files in the path that match the pattern.
> print $entry/$pattern
> done
Filename expansion is not done when patterns are stored in variables.
You have to force it using the $~var syntax.
Try this:
print $entry/$~pattern
Best regards,
--
Jérémie
Messages sorted by:
Reverse Date,
Date,
Thread,
Author