#!/bin/bash array1=(1 3 5 6 7 9) array2=(3 4 9) echo array1=${array1[@]} echo array2=${array2[@]} for i in ${array1[@]};do for j in ${array2[@]};do if [ $i -eq $j ];then echo -e " 33[32m same number is $i 33[0m" fi done done
#!/bin/bash array1=(1 3 5 6 7 9) array2=(3 4 9) echo array1=${array1[@]} echo array2=${array2[@]} for i in ${array1[@]};do for j in ${array2[@]};do if [ $i -eq $j ];then echo -e " 33[32m same number is $i 33[0m" fi done done