grep -L "news.tmpl" *.mdwn | while read file ; do sed -i '/meta title/a [[!pagetemplate template="news.tmpl"]]' $file done