readarray Command Examples

Read lines from stdin into an array. More information: https://www.gnu.org/software/bash/manual/bash.html#index-readarray.

readarray {{array_name}}

readarray {{array_name}} < {{path/to/file.txt}}

readarray -t {{array_name}} < {{path/to/file.txt}}

readarray -n {{N}} {{array_name}} < {{path/to/file.txt}}