help with sed

Hello all..New with scripting so please bear with me...I have a file which has a particular

$$START_DT=2006-01-01 several times in the file...so the file looks like
-----------------
dddd
$$START_DT=2006-01-01

ddffff
$$START_DT=2006-01-01
-----------------
etc...

Now, i want to find and replace every occurence of $$START_DT=2006-01-01 with $$START_DT=current_date

below is wat I have got
---------------------
#!/usr/bin/ksh

dt=`date +%Y-%m-%d`
echo $dt
sed "s/START_DT=*/START_DT=${dt}/g" file1.tst > file2.tst
---------------------
But this only replaces $$START_DT=2006-01-01 with $$START_DT=2006-10-19. I want to use wild chars with sed so tht even if the date changes my script will change the date to current date.

So basically I want to find/replace $$START_DT=yyyy-mm-dd with $$START_DT=current_date in format yyyy-mm-dd.

Any help appreciated.

Try this:

 sed "s/=.*/=$(date +%F)/g"
#!/usr/bin/ksh

dt=`date +%Y-%m-%d`
echo $dt
sed "s/START_DT=.*/START_DT=${dt}/g" file1.tst > file2.tst

Your code should work if you add dot before asterisks.

Thanks anbu...it works...

now suppose I wanna do date-1..meaning I need yesterdays date in the script..How wud I do tht...I searched some in this forum (here ) but seems like everybody is doing too much for a simple thing like tht...

meaning I read some where people are using a script to convert date to julian--then subtracting it...

isnt there something simpler with the date function?

Also I came across this option while searching...seems interesting...

I wonder if I can use this to suit my purpose

$ TZ=GMT+24 date
Wed Oct 18 20:12:18 GMT 2006

So it did give me yesterdays date...i wonder if I can use this somehow...Ne tips?

Use Perderabo's datecalc script -- http://www.unix.com/showthread.php?p=16559\#post16559