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

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -