OIFS="$IFS" IFS=$'\n' for f in $(git log --branches --pretty=format:"%s" --since="5am") do #watch out for / in commit messages nf=${f//\//:} echo $nf touch ~/gtd/done/$(date '+%Y-%m-%d')/"$nf".txt done IFS="$OIFS"