I’m having trouble getting a list of files into an array. arr=( * ) works when i’m in the directory in question, but arr=( path-to-dir/* ) dosen’t seem to work.
arr=( $(ls -1 path-to-dir) works, but from my understanding, using ls -1 is not a good idea.
What’s the best way to capture the files in a directory into an array if it’s not in your $PWD?