0
I’m writing a script and using while read
twice he makes the 1 only once:
un=$(echo $LOGNAME | tr '[A-Z]' '[a-z]')
grep -v '^#' nodeteste.txt > auxiliar.txt
while read line
do
ssh "$un@$line" "cat arquivo" > arquivo.externo
cut -d "," -f 1 arquivo.externo > arquivo.externo.cut
uniq arquivo.externo.cut > arquivo.externo.cut.uniq
while read line2
do
valor=$(grep -c "$line2 " arquivo.base)
if [ $valor -eq 0 ]; then
echo $line >> arquivo.base.diferente
echo $line2 >> arquivo.base.diferente
grep -i "$line2," arquivo.externo >> arquivo.base.diferente
echo $line $line2 $valor "eh diferente"
fi
done < arquivo.externo.cut.uniq
done < auxiliar.txt
rm auxiliar.txt
he executes the first while
just once, I’m suspicious that he missed stdin/out at some point!! Someone could give some hint!!