シェルスクリプトを組むときに,良く使うコマンド.
dir=`dirname $file`
「href="..."」 の 「"」で括られた部分のみを抽出
sed -n -e '{ s/.*href="\([^"#?]*\).*$/\1/p }'