vstup_slova="vstup.txt"; n=2; readarray slova < $vstup_slova;  pocet_slov=${#slova[@]}; for (( a=0; a != $pocet_slov; a++)) do za_sebou=1; for (( b=$a+1; b != $pocet_slov; b++)) do if [ "x${slova[$a]}" != "x${slova[$b]}" ]; then  break; fi; let za_sebou++; done; if [ $za_sebou = $n ]; then echo ${slova[$a]}; fi; done

