# basics cat < ${TMPDIR}/bash-zzz << EOF abc EOF cat >> ${TMPDIR}/bash-zzz << EOF def ghi jkl mno EOF cat ${TMPDIR}/bash-zzz rm -f ${TMPDIR}/bash-zzz # make sure command printing puts the here-document as the last redirection # on the line, and the function export code preserves syntactic correctness fff() { ed ${TMPDIR}/foo </dev/null /^name/d w q ENDOFINPUT aa=1 } type fff export -f fff ${THIS_SH} -c 'type fff' ${THIS_SH} ./heredoc1.sub # test heredocs in command substitutions ${THIS_SH} ./heredoc2.sub ${THIS_SH} ./heredoc3.sub ${THIS_SH} ./heredoc4.sub # heredoc tests that use different size documents to test pipe implementation ${THIS_SH} ./heredoc5.sub echo $( cat <<< "comsub here-string" ) # check that end of file delimits a here-document # THIS MUST BE LAST! cat << EOF hi there