---------- Post updated at 08:31 PM ---------- Previous update was at 08:14 PM ----------
By the way, the errors most likely are because it needs spaces between [ and ]
Nevertheless, you are saying something you do not intend to.
The value stored in the variable ip is equal to the literal string formed with the characters (cat /etc/hosts.deny | grep {[*]value in ip variable})
Very unlikely.
[*] the ip variable will be expanded and its content will show instead.