logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Read Array - Populate Arrays from Input | Online Free DevTools by Hexmos

Read array data from stdin with Readarray, a command-line tool for populating arrays. Efficiently manage data input and streamline scripting. Free online tool, no registration required.

readarray

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

  • Interactively input lines into an array:

readarray {{array_name}}

  • Read lines from a file and insert them in an array:

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

  • Remove trailing deliminators (newline by default):

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

  • Copy at most n lines:

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

  • Display help:

help mapfile

See Also