How can I use the output of a command while while working with sed?

Hi guys,

I was facing problems with the following scenario for the last several hours, can anyone help me out?

rm -f /www/emailout/template.html

TODAY=`date '+%d-%m-%y'`

DBRUN=`ps ax | grep dtd `

sed -e 's/ncTODAY/'"$TODAY"'/g' -e "s/ncdbrun/'"$DBRUN"'/g" /www/emailout/test1.html > /www/emailout/template.html

But, I can't get the output of $DBRUN ?

What would be the solution, can anyone please fix the problem for me?

Free Dummies Books
Continuous Engineering

Learn:

  • What continuous engineering is
  • How to continuously improve complex product designs
  • How to anticipate and respond to markets and clients
  • How to get the most out of your engineering resources

Get your free book now

Sponsored by IBM

Free Dummies Books
Service Virtualization

Learn to:

  • Define service virtualization
  • Select the most beneficial services to virtualize
  • Improve your traditional approach to testing
  • Deliver higher-quality software faster

Get your free book now

Sponsored by IBM