Sed substistution

Folks,
I am trying to put in a sed command in my script to update the curent time value. It throws me syntax error..but If i execute the same command with the value substituted from outside, it works.

I am not able to figure out whats the issue with the command.

Appriciate ur help.

***********************************
now=`date +20%y-%m-%d" "%T`
for file in `ls testrun*`
do
sed 's/CURRENT_TIME/'$now'/' $file > $file.properties;
done

***********************************

sed: -e expression #1, char 25: unterminated `s' command
+ for file in '`ls testrun*`'
+ sed s/CURRENT_TIME/2007-10-12 01:03:20/ testrun_console.bak
sed: -e expression #1, char 25: unterminated `s' command

--Venkat.

It's due to the space in your date string.

Try the following sed command:

sed "s/CURRENT_TIME/$now/" $file > $file.properties

Cheers,
ZB

Hey ZB,
that works like a charm.
using " instead of ' solved my issue.

Thanks.

--Venkat.