With bash script/python/perl script, is it possible to show if the output of a command without a string, e.g.
curl -i http://www.google.com
HTTP/1.1 302 Found
Location: http://www.google.com.hk/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
What I want to do is:
- If the output contains 302, print nothing
- Else, print
302 is missed
You can use the result of the
curl|grepsilented as test :