heredoc.tests
来自「android-w.song.android.widget」· TESTS 代码 · 共 101 行
TESTS
101 行
# check order and content of multiple here docscat << EOF1 << EOF2 hiEOF1thereEOF2while read line1; do read line2 <&3 echo $line1 - $line2done <<EOF1 3<<EOF2onetwothreeEOF1alphabetagammaEOF2# check quoted here-doc is protecteda=foocat << 'EOF'hi\there$astuffEOF# check that quoted here-documents don't have \newline processing donecat << 'EOF'hi\thereEO\FEOFtrue# check that \newline is removed at start of here-doccat << EO\FhiEOF# check that \newline removal works for here-doc delimitercat << EOFhiEO\F# check operation of tab removal in here documentscat <<- EOF tab 1 tab 2 tab 3 EOF# check appending of text to file from here documentrm -f /tmp/bash-zzzcat > /tmp/bash-zzz << EOFabcEOFcat >> /tmp/bash-zzz << EOFdef ghijkl mnoEOFcat /tmp/bash-zzzrm -f /tmp/bash-zzz# make sure command printing puts the here-document as the last redirection# on the line, and the function export code preserves syntactic correctnessfff(){ ed /tmp/foo <<ENDOFINPUT >/dev/null/^name/dwqENDOFINPUTaa=1}type fffexport -f fff${THIS_SH} -c 'type fff'${THIS_SH} ./heredoc1.subecho $( cat <<< "comsub here-string")# check that end of file delimits a here-document# THIS MUST BE LAST!cat << EOFhithere
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?