?? heredoc.tests
字號:
# check order and content of multiple here docscat << EOF1 << EOF2hiEOF1thereEOF2while 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#ash# # check that \newline removal works for here-doc delimiter#ash# cat << EOF#ash# hi#ash# EO\#ash# 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 fff#ash# export -f fff#ash# ${THIS_SH} -c 'type fff'# check that end of file delimits a here-document# THIS MUST BE LAST!cat << EOFhithere
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -