Bash function to read the lines of a file into an array using the builtin, mapfile.

Posted . Visible to the public.
  • Reads the lines of the specified file into an array. The resulting array is in the dedicated variable, MAPFILE.
  • Skips "commented" lines or portions of lines.
  • Skips blank lines.
  • Trims leading & trailing spaces in every line.
aslamK
Last edit
Tags