My code is:
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
Is $machine1 taken as a variable or a string? If a string, how can I change it — by adding a quote?
$machinewill expand tohead $1 -n $i | tail -1result,$machine1will expand tohead $1 -n $nb_lignes | tail -1result.You could figured it out by yourself.
Btw,
ssh root@…