Tente o seguinte comando:
curl -s http://www.example.com | grep -Po '(?<=src=")[^"]*(jpg|png)'
Explicação :
De man grep :
-o, --only-matching
Print only the matched (non-empty) parts of a matching line,
with each such part on a separate output line.
-P, --perl-regexp
Interpret PATTERN as a Perl compatible regular expression (PCRE)
O lookbehind (?<=src=) afirma que na posição atual na string, o que precede são os caracteres src= . Então, procuramos tudo, exceto " , que termina com jpg ou png.