I need a script for build an array with the names of files in a folder. For example in the folder1
I have 4 files, so the array must have in position 0,1,2,3 the names of these 4 files. I've found this script:
declare -a FILELIST
for f in *; do
FILELIST[${#FILELIST[@]}+1]=$(echo "$f");
done
echo ${FILELIST[@]}
but I'm new to bash
and I don't understand the meaning behind these commands.