add not equal in script.

Hi, i just want to print the value which are not equal. I try with $str != ${comp2[i]} but still getting same values.

for str in ${comp1[]}; do
i=0
while (( $i < ${#comp2[
]} )); do
if [[ $str = ${comp2[i]} ]]; then
print value here.
break
fi
(( i += 1 ))
done
done

thanks for you help.

if in case you are trying to compare numeric values, use -ne instead of !=
!= is for string comparison

Hi Yogesh, i tried yesterday also. I have char & numeic value (lg. ge45678).
I got some good result but still getting similar valuses too. is there something diffrent i can try?