'how bash grep match string with blank spaces, -F not work

Need to check iptables has some rules with grep:

# iptables-save
-A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT

check with grep and -F, neither work:

# iptables-save | grep '-A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT'
grep:  INPUT -p tcp -m tcp --dport 8088 -j ACCEPT: invalid context length argument

# iptables-save | grep -F '-A INPUT -p tcp -m tcp --dport 8088 -j ACCEPT'
grep:  INPUT -p tcp -m tcp --dport 8088 -j ACCEPT: invalid context length argument

I think that because of the -A was recognize with a OPTIONS parameter while the match pattern has the white spaces, but it also doesn't work while I used -F. What's wrong with me? And I can't find the result by google, how could I solve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source