I\'m trying to store the files listing into an array and then loop through the array again. Below is what I get when I run ls -ls command from the console.
ls -ls
Running any shell command inside $(...) will help to store the output in a variable. So using that we can convert the files to array with IFS.
$(...)
IFS
IFS=' ' read -r -a array <<< $(ls /path/to/dir)