man 3 glob man 3 fnmatch man 1 bash -> read the section called "Pattern Matching" under "EXPANSION".
in this case, $(ls) would unnecessarily spawn a subshell for listing files. You
can often get the same result by using wildcard expansion (or globbing) like
Michal said:
for lang in *; do
...
done
It is often faster.
Cheers,
Patrice
Sunday 28 Jun 2015 14:25:25, Johannes Huber wrote :
> On Sunday 28 June 2015 04:12:01 Michal Górny wrote:
>
> > > + for lang in $(ls) ; do
> >
> > How about... for lang in *?
>
> What is the advantage?
>
> Greetings
> --
> Johannes Huber (johu)
> Gentoo Linux Developer / KDE Team
> GPG Key ID FDF4F788
pgpz97nHdicW7.pgp
Description: PGP signature
