Posts by Ed Morton
Populate an array of the file names and then print how many entries are in the array: $ files=( * ) $ echo "${#files[@]}" 124 That will work correctly even if your file names contain newlines...
Answer
Populate an array of the file names and then print how many entries are in the array: $ files=( * ) $ echo "${#files[@]}" 124 That will work correctly even if your file names contain newlines...