I have a project that has a lot of directories which contain files with extension
These files are localizations in several languages.
For example, I may have 3 files with the same name, like
MyView.strings but each file is inside a localization directory like
pt-PT.lproj. There are hundreds of these directories inside the project structure.
I am creating a bash script to list the directories where all these files are, by language.
Example: I would like to scan the directory structure and find all
en.lproj directories the structure may have and list the full path of all files inside these directories.
For that matter, a command like that will do the trick on the terminal window
find . -type d -name "en.lproj" -print
but how do I store the result of such a command to an array that I can enumerate later, inside a bash script?
I have tried this
result=($(find . -type d -name "en.lproj" -print))
but because the paths contain spaces, the array is broken on that spaces, and I was expecting result to be an array where each line is a path, containing or not spaces.
I am on macOS BigSur.