Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
bash脚本sftp退出终止脚本_Bash_Sftp - Fatal编程技术网

bash脚本sftp退出终止脚本

bash脚本sftp退出终止脚本,bash,sftp,Bash,Sftp,我是bash脚本新手,遇到了一个问题 下面是我的脚本示例 NOW=$(date +"%m-%d-%Y-%H") echo -e "\nSFTP connection" sftp username@ip <<EOT lcd local_folder/ cd remote_folder/ mget *.txt exit EOT ##here it stops echo -e "\nNew folder" cat email_list | while read line do

我是bash脚本新手,遇到了一个问题 下面是我的脚本示例

NOW=$(date +"%m-%d-%Y-%H")

echo -e "\nSFTP connection"
sftp username@ip <<EOT
lcd local_folder/
cd remote_folder/
mget *.txt
exit
EOT

##here it stops  

echo -e "\nNew folder"

cat email_list | while read line
do
    mail -s "topic" $line < text.txt
done

echo -e "\nSent"

}
NOW=$(日期+%m-%d-%Y-%H)
echo-e“\nSFTP连接”

sftpusername@ipEOT是否在脚本的左边距?如果缩进,则无法识别巴尔马


您可以使用脚本的左边距是否有EOT?如果缩进,则无法识别巴尔马


您可以使用请向我们展示整个脚本。
EOT
是否在脚本的左边距?如果缩进,则无法识别。您可以使用结尾处的“}”是什么?这是bash脚本吗?开始工作了!谢谢Barmar的建议!请给我们看整个脚本。
EOT
在脚本的左边吗?如果缩进,则无法识别。您可以使用结尾处的“}”是什么?这是bash脚本吗?开始工作了!谢谢Barmar的建议!