これは私のコードです:
nb_lignes=`wc -l $1 | cut -d " " -f1`
for i in $(seq $(($nb_lignes - 1)) )
do
machine=`head $1 -n $i | tail -1`
machine1=`head $1 -n $nb_lignes | tail -1`
ssh root@$machine -x " scp /home/file.txt root@$machine1:/home && rm -r /home/file.txt"
done
scp et rmの前にfile.txtがそのようなマシンに存在するかどうかを確認したいのですが、このスクリプトを変更するにはどうすればよいですか?
ありがとうございました。