bash - checking if grep command returns correct output -


thing using wget extract url after want pipe grep check if matches pattern , if echo name of url.

something this:

wget url |grep "pattern"  if successful display urlname 

an if condition true if command returns 0. grep returns 0 if matches pattern input.

if wget -o - ... | grep -q ...    ... fi 

Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -