for i in $(find template -type f | sed 's/^template//') ; do    diff -wBNu {,./template}$iI can understand the for loop which will traverse all the files in the template directory and then replace all the sentence starting with template with ''. Is this understanding correct? What does the diff do here? 
What does diff with curly braces denote?
bash;shell script
The braces perform shell 'brace expansion'. The construct {,./template}$i produces a pair of words, both containing the value of $i, but the latter has ./template prepended. Try the commandecho foo{,bar}at the shell prompt to see it in action. This is documented under Brace expansion in the bash manual.