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

Re: Glob problem



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