[opensuse] Re: BASH - better way to get total number of files matching glob??
Jon Clausen wrote:
Looking only at:
array=( $path/$glob ) vs. array=( $(ls $path/$glob) )
- where the resulting arrays should be more or less identical
not at all: the former does no shell word splitting on white space, the latter does. And if $path or $glob contain white space, your 2nd command won't work at all. Joachim -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Joachim Schrod Email: jschrod@acm.org Roedermark, Germany -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Mon, 07 Jun, 2010 at 13:08:23 +0200, Joachim Schrod wrote:
Jon Clausen wrote:
Looking only at:
array=( $path/$glob ) vs. array=( $(ls $path/$glob) )
- where the resulting arrays should be more or less identical
not at all: the former does no shell word splitting on white space, the latter does. And if $path or $glob contain white space, your 2nd command won't work at all.
It's out of context, but point taken. /jon -- YMMV -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
Joachim Schrod
-
Jon Clausen