Recipes

Append after match

1
for i in *.org; do sed '/^#+title.*/a #+date=`basename $i .org`' $i; done

This will append the basename after each line containing #+title.