- No spaces before and after the
=
- No dollar sign in the assignment
You probably want the result of the command, so enclose it in
$(
)
ip=$(host $i |grep -o -m 100 '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}')
write to the file like this
echo "$i" >> /root/activedomains.txt