shell 將"<<"當成一條指令,該指令用於讀取輸入直到它在輸入行中找到包含指定的定界符"!"的行爲止。定界符"!"前的行都被反饋到"<<"前的命令command的標準輸入中。
!/bin/sh
sftp [email protected] << !
cd /etc/
lcd /opt/upload/
-get 123.txt
-get 456.txt
-get 789.txt
quit
!
!/bin/sh
sftp [email protected] << !
cd /etc/
lcd /opt/upload/
-get 123.txt
-get 456.txt
-get 789.txt
quit
!