# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # # 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 # test $'...' and $"..." quoted strings in here-documents ${THIS_SH} ./heredoc6.sub # interaction between here-documents and command substitutions ${THIS_SH} ./heredoc7.sub echo $( cat <<< "comsub here-string" ) # check that end of file delimits a here-document # THIS MUST BE LAST! cat << EOF hi there