Here's another technique along the lines of the one Gilles posted:
word_count () { local c=("$@"); echo "${#c[@]}"; }
file_count=$(word_count *)
which creates an array with 13,923 elements (if that's how many files there are).
Here's another technique along the lines of the one Gilles posted:
word_count () { local c=("$@"); echo "${#c[@]}"; }
file_count=$(word_count *)
which creates an array with 13,923 elements (if that's how many files there are).