# Basic syntax: while IFS= read line; do FILE_IN_ARRAY+=("$line") done </path/to/your/file.txt # Where: # - this site explains arrays helpfully: # https://linuxize.com/post/bash-arrays/