Using Bash as libraries for writing tests
Good guide and doc for Bash arrays. Also clearly states difference between array (indexed array=list) and associative array (keyd array=map)
Shows how to build super complex useful command pipes easily with xargs
Convert string or command output into bash array
Convert a string or command output into bash array variable
This answers newlines in Strings.
Short answer is to always use “$@“ (quoted)