while read -n1 _ read -n1 b read -n1 c read -n1 _ read -n1 d read _ [ $b = $c ]&&echo $b||echo $d end