Answers:
假设您有一个destfile.txt带有user@host-values 的文件(),每行一个。然后您可以这样做:
while IFS= read -r dest; do
scp ourfile.txt "$dest:remote/path/"
done <destfile.txt
for-loop 更改为while read dest; do,它将从标准输入读取。将其放在脚本中,然后将其destfile.txt输入(例如./thescript.sh <destfile.txt)。