Gentoo Archives: gentoo-dev

From: Patrice Clement <monsieurp@g.o>
To: gentoo-dev@l.g.o
Cc: "Michal Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass
Date: Sun, 28 Jun 2015 12:46:18
Message-Id: 20150628124601.GL39454@sigkill.axestech.net
In Reply to: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog kde5-functions.eclass kde5.eclass by Johannes Huber
1 man 3 glob
2 man 3 fnmatch
3 man 1 bash -> read the section called "Pattern Matching" under "EXPANSION".
4
5 in this case, $(ls) would unnecessarily spawn a subshell for listing files. You
6 can often get the same result by using wildcard expansion (or globbing) like
7 Michal said:
8
9 for lang in *; do
10 ...
11 done
12
13 It is often faster.
14
15 Cheers,
16 Patrice
17
18 Sunday 28 Jun 2015 14:25:25, Johannes Huber wrote :
19 > On Sunday 28 June 2015 04:12:01 Michal Górny wrote:
20 >
21 > > > + for lang in $(ls) ; do
22 > >
23 > > How about... for lang in *?
24 >
25 > What is the advantage?
26 >
27 > Greetings
28 > --
29 > Johannes Huber (johu)
30 > Gentoo Linux Developer / KDE Team
31 > GPG Key ID FDF4F788

Replies