Read lines from a file into a Bash array [duplicate] June 10, 2022 by Tarik The readarray command (also spelled mapfile) was introduced in bash 4.0. readarray -t a < /path/to/filename