使用bash script/python/perl script
,是否可以显示命令的输出是否没有字符串,例如
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
我想做的是:
- 如果输出包含 302,则不打印
- 否则,打印
302 is missed