<< EOF
表示輸入 EOF
時結束輸入。
[dywang@dywmac zzz]$ cat > shdata1.txt << EOF > 23 > 43 > 156 > 32 > EOF [dywang@dywmac zzz]$ cat shdata1.txt 23 43 156 32 [dywang@dywmac zzz]$ awk '{sum+=$1} END {print "total="sum}' shdata1.txt total=254
[dywang@dywmac zzz]$ vim sh02.sh [dywang@dywmac zzz]$ cat sh02.sh #!/bin/bash cat > shdata1.txt << EOF 23 43 156 32 EOF cat shdata1.txt awk '{sum+=$1;} END {print "total="sum}' shdata1.txt exit 0
[dywang@dywmac zzz]$ sh sh02.sh 23 43 156 32 total=254