It workes by adding wait like this
#!/bin/bash
INPUT=Mnt.csv
OLDIFS=$IFS
IFS=','
[ ! -f $INPUT ] && { echo "$INPUT file not found"; exit 99; }
while read dom alias port ver
do
ssh -n $alias "
echo =======================================================
echo $alias
echo =======================================================
if [ ${ver} = "v3" ]
then
instruction 1
........
........
........
instruction n
else
instruction A
........
........
........
instruction X
fi
wait
exit" >> $(date +%Y%m%d).log
wait
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…