zsh-users
 help / color / mirror / code / Atom feed
* Glob problem
@ 2013-10-22 16:45 Brent Briggs
  2013-10-22 16:58 ` Jérémie Roquet
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Brent Briggs @ 2013-10-22 16:45 UTC (permalink / raw)
  To: zsh-users

Hello Zsh masters,

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

Expected/Desired Output:
------------------------
/opt/local/bin/git
/opt/local/bin/git-credential-osxkeychain
/opt/local/bin/git-cvsserver
/opt/local/bin/git-receive-pack
/opt/local/bin/git-shell
/opt/local/bin/git-upload-archive
/opt/local/bin/git-upload-pack
/opt/local/bin/gitk
/usr/bin/git
/usr/bin/git-cvsserver
/usr/bin/git-receive-pack
/usr/bin/git-shell
/usr/bin/git-upload-archive
/usr/bin/git-upload-pack

Actual Output:
-------------------
/opt/local/bin/git*
/opt/local/sbin/git*
/opt/local/bin/git*
/opt/local/sbin/git*
/usr/bin/git*
/bin/git*
/usr/sbin/git*
/sbin/git*
/usr/local/bin/git*
/usr/local/MacGPG2/bin/git*
/Users/brent/bin/git*
/Users/brent/bin/git*

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-10-23 14:30 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-22 16:45 Glob problem Brent Briggs
2013-10-22 16:58 ` Jérémie Roquet
2013-10-22 16:59 ` Peter Stephenson
2013-10-22 17:05 ` Philippe Troin
2013-10-22 18:02   ` Brent Briggs
2013-10-22 18:12     ` Peter Miller
2013-10-22 18:49       ` Brent Briggs
2013-10-22 19:30         ` Peter Miller
2013-10-22 20:11         ` Yuya Amemiya
2013-10-23 12:27           ` Brent Briggs
2013-10-23 12:37             ` Jérémie Roquet
2013-10-23 13:47             ` Peter Stephenson
2013-10-23 14:29             ` Yuya Amemiya
2013-10-22 17:11 ` Matt Garriott

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).