i have a below script:
for (( i=0; i <= ( ${#arr1[@]} - 1); i++ )); do
if [[ ${arr1[i]} > 100 ]]; then
echo "=> x"
iptables -A INPUT -s 192.168.162.1 -j DROP
exit
else
echo "=> y"
fi
done
In my array, no element > 100, all output must be "=> y".
when arr1[i]=1, it's OK. output: "=> y"
But when arr1[i]=5 or anything is not 1, it has a problem, output "=> x"
I think my problem is here if [[ ${arr1[i]} > 100 ]] but I dont know how to edit it. :(
Help me correct it . please . Thanks a lot