A script takes a URL, parses it for the required fields, and redirects its output to be saved in a file, file.txt. The output is saved on a new line each time a fie
Use the mapfile command:
mapfile -t myArray < file.txt
The error is using for -- the idiomatic way to loop over lines of a file is:
for
while IFS= read -r line; do echo ">>$line<<"; done < file.txt
See BashFAQ/005 for more details.