Mapping a file to a variable in bash

On Unix-like operating systems, mapfile is a builtin command of the Bash shell. It reads lines from standard input into an indexed array variable.

mapfile remote.txt
echo "Hello this is first line: ${MAPFILE[0]}"