arguments+=() expected_exitcode=0 # set IFS="" if you want trailing new line(s), otherwise remove it IFS="" read -d '' expected_output <<'EOF' EOF IFS="" read -d '' expected_result <<'EOF' EOF