I'm using sed for parse some HTML page, here is the code:
name=`echo $p | sed -n 's/.*href=\"\([^"]*\)" class=\"alleLink iTitle\"><span>\([^<]*\)<\/span>.*/\1/p'`;
When there is a match it works good - returns required substring. But when there is no match, sed just freeze and the script is doing nothing. I just wanna receive empty string or something like that.
Do you know what to do?
Thanks Roman Zkamene