Thing is that I am using wget to extract url after that I want to pipe it to grep to check if it matches some pattern and if it does simply echo name of url.
wget
An if condition is true if its command returns 0. grep returns 0 if it matches the pattern to the input.
if
grep
if wget -O - ... | grep -q ... then ... fi