sed + awk working together? So,

My environment is very heavily bash based. But I want to put a web interface to parts of the thing, to make it easier to use. Here is the scenario.

 I want is the ability  to execute say

`echo -n 123456 | md5sum | awk '{print $1}'| sed -i -e s/TEMPLATE/MD5SUM_OUTPUT/g the.script.i.am.changing`

How do I get the md5sum into where it says `MD5SUM_OUTPUT`? This way sed can then run with it. It awk the right tool here?

Thanks.